fix: correct TanStack Router search types for all navigate/Link calls
Some checks failed
Build & Release / build (push) Failing after 33s

Each destination route's search must match its validateSearch shape exactly:
- Detail pages (tab-based): { tab: '...' }
- List pages with extra filters: include status, instructorId, view, categoryId etc.
- Form pages (enrollments/new, repairs/new): include only their specific fields
- use-pagination.ts: fix search reducer to use (prev: any) instead of invalid cast

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ryan Moon
2026-04-05 10:37:34 -05:00
parent a84530e80e
commit 505f8fd4e4
13 changed files with 24 additions and 24 deletions

View File

@@ -23,12 +23,12 @@ export function usePagination() {
function setParams(updates: Partial<PaginationSearch>) {
navigate({
search: ((prev: Record<string, unknown>) => ({
search: (prev: any) => ({
...prev,
...updates,
// Reset to page 1 when search or sort changes
page: updates.q !== undefined || updates.sort !== undefined ? 1 : (updates.page ?? (prev as PaginationSearch).page),
})) as (prev: Record<string, unknown>) => Record<string, unknown>,
}),
replace: true,
})
}