Skip to content

Commit

Permalink
fix: remove the preSearchFilters
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanCassiere committed Aug 21, 2024
1 parent ade409d commit 0e7776d
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const Route = createFileRoute(
stage: z.string().optional(),
})
.parse(search),
preSearchFilters: [() => ({ stage: "rental-information" })],
component: CheckinAgreementPage,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const Route = createFileRoute(
stage: z.string().optional(),
})
.parse(search),
preSearchFilters: [() => ({ stage: "rental-information" })],
component: EditAgreementPage,
});

Expand Down
8 changes: 0 additions & 8 deletions src/routes/_auth/(agreements)/agreements.index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ import {
AgreementDateTimeColumns,
sortColOrderByOrderIndex,
} from "@/lib/utils/columns";
import { STORAGE_DEFAULTS } from "@/lib/utils/constants";
import { getXPaginationFromHeaders } from "@/lib/utils/headers";
import { normalizeAgreementListSearchParams } from "@/lib/utils/normalize-search-params";
import { insertSpacesBeforeCaps } from "@/lib/utils/random";
Expand All @@ -64,13 +63,6 @@ import { sortObjectKeys } from "@/lib/utils";

export const Route = createFileRoute("/_auth/(agreements)/agreements/")({
validateSearch: (search) => AgreementSearchQuerySchema.parse(search),
preSearchFilters: [
(search) => ({
page: search?.page || 1,
size: search?.size || parseInt(STORAGE_DEFAULTS.tableRowCount),
filters: search?.filters ?? undefined,
}),
],
beforeLoad: ({ context, search }) => {
const auth = getAuthFromRouterContext(context);
const parsedSearch = normalizeAgreementListSearchParams(search);
Expand Down
1 change: 0 additions & 1 deletion src/routes/_auth/(agreements)/agreements.new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export const Route = createFileRoute("/_auth/(agreements)/agreements/new")({
stage: z.string().optional(),
})
.parse(search),
preSearchFilters: [() => ({ stage: "rental-information" })],
component: AddAgreementPage,
});

Expand Down
8 changes: 0 additions & 8 deletions src/routes/_auth/(customers)/customers.index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import { Container } from "@/routes/-components/container";

import { getAuthFromRouterContext } from "@/lib/utils/auth";
import { sortColOrderByOrderIndex } from "@/lib/utils/columns";
import { STORAGE_DEFAULTS } from "@/lib/utils/constants";
import { getXPaginationFromHeaders } from "@/lib/utils/headers";
import { normalizeCustomerListSearchParams } from "@/lib/utils/normalize-search-params";
import { insertSpacesBeforeCaps } from "@/lib/utils/random";
Expand All @@ -56,13 +55,6 @@ import { titleMaker } from "@/lib/utils/title-maker";

export const Route = createFileRoute("/_auth/(customers)/customers/")({
validateSearch: (search) => CustomerSearchQuerySchema.parse(search),
preSearchFilters: [
(search) => ({
page: search?.page || 1,
size: search?.size || parseInt(STORAGE_DEFAULTS.tableRowCount),
filters: search?.filters ?? undefined,
}),
],
beforeLoad: ({ context, search }) => {
const auth = getAuthFromRouterContext(context);
const parsedSearch = normalizeCustomerListSearchParams(search);
Expand Down
8 changes: 0 additions & 8 deletions src/routes/_auth/(fleet)/fleet.index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import { Container } from "@/routes/-components/container";

import { getAuthFromRouterContext } from "@/lib/utils/auth";
import { sortColOrderByOrderIndex } from "@/lib/utils/columns";
import { STORAGE_DEFAULTS } from "@/lib/utils/constants";
import { getXPaginationFromHeaders } from "@/lib/utils/headers";
import { normalizeVehicleListSearchParams } from "@/lib/utils/normalize-search-params";
import { insertSpacesBeforeCaps } from "@/lib/utils/random";
Expand All @@ -58,13 +57,6 @@ import { titleMaker } from "@/lib/utils/title-maker";

export const Route = createFileRoute("/_auth/(fleet)/fleet/")({
validateSearch: (search) => VehicleSearchQuerySchema.parse(search),
preSearchFilters: [
(search) => ({
page: search?.page || 1,
size: search?.size || parseInt(STORAGE_DEFAULTS.tableRowCount),
filters: search?.filters ?? undefined,
}),
],
beforeLoad: ({ context, search }) => {
const auth = getAuthFromRouterContext(context);
const parsedSearch = normalizeVehicleListSearchParams(search);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const Route = createFileRoute(
stage: z.string().optional(),
})
.parse(search),
preSearchFilters: [() => ({ stage: "rental-information" })],
component: EditReservationPage,
});

Expand Down
7 changes: 0 additions & 7 deletions src/routes/_auth/(reservations)/reservations.index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,6 @@ import { titleMaker } from "@/lib/utils/title-maker";

export const Route = createFileRoute("/_auth/(reservations)/reservations/")({
validateSearch: (search) => ReservationSearchQuerySchema.parse(search),
preSearchFilters: [
(search) => ({
page: search?.page || 1,
size: search?.size || parseInt(STORAGE_DEFAULTS.tableRowCount),
filters: search?.filters ?? undefined,
}),
],
beforeLoad: ({ context, search }) => {
const auth = getAuthFromRouterContext(context);
const parsedSearch = normalizeReservationListSearchParams(search);
Expand Down
1 change: 0 additions & 1 deletion src/routes/_auth/(reservations)/reservations.new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export const Route = createFileRoute("/_auth/(reservations)/reservations/new")({
stage: z.string().optional(),
})
.parse(search),
preSearchFilters: [() => ({ stage: "rental-information" })],
component: AddReservationPage,
});

Expand Down

0 comments on commit 0e7776d

Please sign in to comment.