Skip to content

Commit 14684d0

Browse files
committed
try fix types
1 parent cf111d2 commit 14684d0

File tree

3 files changed

+196
-86
lines changed

3 files changed

+196
-86
lines changed

frontend/src/routeTree.gen.ts

Lines changed: 188 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,129 +1,235 @@
1-
/* prettier-ignore-start */
2-
31
/* eslint-disable */
42

53
// @ts-nocheck
64

75
// noinspection JSUnusedGlobalSymbols
86

9-
// This file is auto-generated by TanStack Router
10-
11-
// Import Routes
12-
13-
import { Route as rootRoute } from './routes/__root'
14-
import { Route as SignupImport } from './routes/signup'
15-
import { Route as ResetPasswordImport } from './routes/reset-password'
16-
import { Route as RecoverPasswordImport } from './routes/recover-password'
17-
import { Route as LoginImport } from './routes/login'
18-
import { Route as LayoutImport } from './routes/_layout'
19-
import { Route as LayoutIndexImport } from './routes/_layout/index'
20-
import { Route as LayoutSettingsImport } from './routes/_layout/settings'
21-
import { Route as LayoutItemsImport } from './routes/_layout/items'
22-
import { Route as LayoutAdminImport } from './routes/_layout/admin'
23-
24-
// Create/Update Routes
25-
26-
const SignupRoute = SignupImport.update({
7+
// This file was automatically generated by TanStack Router.
8+
// You should NOT make any changes in this file as it will be overwritten.
9+
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
10+
11+
import { Route as rootRouteImport } from './routes/__root'
12+
import { Route as SignupRouteImport } from './routes/signup'
13+
import { Route as ResetPasswordRouteImport } from './routes/reset-password'
14+
import { Route as RecoverPasswordRouteImport } from './routes/recover-password'
15+
import { Route as LoginRouteImport } from './routes/login'
16+
import { Route as LayoutRouteImport } from './routes/_layout'
17+
import { Route as LayoutIndexRouteImport } from './routes/_layout/index'
18+
import { Route as LayoutSettingsRouteImport } from './routes/_layout/settings'
19+
import { Route as LayoutItemsRouteImport } from './routes/_layout/items'
20+
import { Route as LayoutAdminRouteImport } from './routes/_layout/admin'
21+
22+
const SignupRoute = SignupRouteImport.update({
23+
id: '/signup',
2724
path: '/signup',
28-
getParentRoute: () => rootRoute,
25+
getParentRoute: () => rootRouteImport,
2926
} as any)
30-
31-
const ResetPasswordRoute = ResetPasswordImport.update({
27+
const ResetPasswordRoute = ResetPasswordRouteImport.update({
28+
id: '/reset-password',
3229
path: '/reset-password',
33-
getParentRoute: () => rootRoute,
30+
getParentRoute: () => rootRouteImport,
3431
} as any)
35-
36-
const RecoverPasswordRoute = RecoverPasswordImport.update({
32+
const RecoverPasswordRoute = RecoverPasswordRouteImport.update({
33+
id: '/recover-password',
3734
path: '/recover-password',
38-
getParentRoute: () => rootRoute,
35+
getParentRoute: () => rootRouteImport,
3936
} as any)
40-
41-
const LoginRoute = LoginImport.update({
37+
const LoginRoute = LoginRouteImport.update({
38+
id: '/login',
4239
path: '/login',
43-
getParentRoute: () => rootRoute,
40+
getParentRoute: () => rootRouteImport,
4441
} as any)
45-
46-
const LayoutRoute = LayoutImport.update({
42+
const LayoutRoute = LayoutRouteImport.update({
4743
id: '/_layout',
48-
getParentRoute: () => rootRoute,
44+
getParentRoute: () => rootRouteImport,
4945
} as any)
50-
51-
const LayoutIndexRoute = LayoutIndexImport.update({
46+
const LayoutIndexRoute = LayoutIndexRouteImport.update({
47+
id: '/',
5248
path: '/',
5349
getParentRoute: () => LayoutRoute,
5450
} as any)
55-
56-
const LayoutSettingsRoute = LayoutSettingsImport.update({
51+
const LayoutSettingsRoute = LayoutSettingsRouteImport.update({
52+
id: '/settings',
5753
path: '/settings',
5854
getParentRoute: () => LayoutRoute,
5955
} as any)
60-
61-
const LayoutItemsRoute = LayoutItemsImport.update({
56+
const LayoutItemsRoute = LayoutItemsRouteImport.update({
57+
id: '/items',
6258
path: '/items',
6359
getParentRoute: () => LayoutRoute,
6460
} as any)
65-
66-
const LayoutAdminRoute = LayoutAdminImport.update({
61+
const LayoutAdminRoute = LayoutAdminRouteImport.update({
62+
id: '/admin',
6763
path: '/admin',
6864
getParentRoute: () => LayoutRoute,
6965
} as any)
7066

71-
// Populate the FileRoutesByPath interface
67+
export interface FileRoutesByFullPath {
68+
'/login': typeof LoginRoute
69+
'/recover-password': typeof RecoverPasswordRoute
70+
'/reset-password': typeof ResetPasswordRoute
71+
'/signup': typeof SignupRoute
72+
'/admin': typeof LayoutAdminRoute
73+
'/items': typeof LayoutItemsRoute
74+
'/settings': typeof LayoutSettingsRoute
75+
'/': typeof LayoutIndexRoute
76+
}
77+
export interface FileRoutesByTo {
78+
'/login': typeof LoginRoute
79+
'/recover-password': typeof RecoverPasswordRoute
80+
'/reset-password': typeof ResetPasswordRoute
81+
'/signup': typeof SignupRoute
82+
'/admin': typeof LayoutAdminRoute
83+
'/items': typeof LayoutItemsRoute
84+
'/settings': typeof LayoutSettingsRoute
85+
'/': typeof LayoutIndexRoute
86+
}
87+
export interface FileRoutesById {
88+
__root__: typeof rootRouteImport
89+
'/_layout': typeof LayoutRouteWithChildren
90+
'/login': typeof LoginRoute
91+
'/recover-password': typeof RecoverPasswordRoute
92+
'/reset-password': typeof ResetPasswordRoute
93+
'/signup': typeof SignupRoute
94+
'/_layout/admin': typeof LayoutAdminRoute
95+
'/_layout/items': typeof LayoutItemsRoute
96+
'/_layout/settings': typeof LayoutSettingsRoute
97+
'/_layout/': typeof LayoutIndexRoute
98+
}
99+
export interface FileRouteTypes {
100+
fileRoutesByFullPath: FileRoutesByFullPath
101+
fullPaths:
102+
| '/login'
103+
| '/recover-password'
104+
| '/reset-password'
105+
| '/signup'
106+
| '/admin'
107+
| '/items'
108+
| '/settings'
109+
| '/'
110+
fileRoutesByTo: FileRoutesByTo
111+
to:
112+
| '/login'
113+
| '/recover-password'
114+
| '/reset-password'
115+
| '/signup'
116+
| '/admin'
117+
| '/items'
118+
| '/settings'
119+
| '/'
120+
id:
121+
| '__root__'
122+
| '/_layout'
123+
| '/login'
124+
| '/recover-password'
125+
| '/reset-password'
126+
| '/signup'
127+
| '/_layout/admin'
128+
| '/_layout/items'
129+
| '/_layout/settings'
130+
| '/_layout/'
131+
fileRoutesById: FileRoutesById
132+
}
133+
export interface RootRouteChildren {
134+
LayoutRoute: typeof LayoutRouteWithChildren
135+
LoginRoute: typeof LoginRoute
136+
RecoverPasswordRoute: typeof RecoverPasswordRoute
137+
ResetPasswordRoute: typeof ResetPasswordRoute
138+
SignupRoute: typeof SignupRoute
139+
}
72140

73141
declare module '@tanstack/react-router' {
74142
interface FileRoutesByPath {
75-
'/_layout': {
76-
preLoaderRoute: typeof LayoutImport
77-
parentRoute: typeof rootRoute
143+
'/signup': {
144+
id: '/signup'
145+
path: '/signup'
146+
fullPath: '/signup'
147+
preLoaderRoute: typeof SignupRouteImport
148+
parentRoute: typeof rootRouteImport
78149
}
79-
'/login': {
80-
preLoaderRoute: typeof LoginImport
81-
parentRoute: typeof rootRoute
150+
'/reset-password': {
151+
id: '/reset-password'
152+
path: '/reset-password'
153+
fullPath: '/reset-password'
154+
preLoaderRoute: typeof ResetPasswordRouteImport
155+
parentRoute: typeof rootRouteImport
82156
}
83157
'/recover-password': {
84-
preLoaderRoute: typeof RecoverPasswordImport
85-
parentRoute: typeof rootRoute
86-
}
87-
'/reset-password': {
88-
preLoaderRoute: typeof ResetPasswordImport
89-
parentRoute: typeof rootRoute
158+
id: '/recover-password'
159+
path: '/recover-password'
160+
fullPath: '/recover-password'
161+
preLoaderRoute: typeof RecoverPasswordRouteImport
162+
parentRoute: typeof rootRouteImport
90163
}
91-
'/signup': {
92-
preLoaderRoute: typeof SignupImport
93-
parentRoute: typeof rootRoute
164+
'/login': {
165+
id: '/login'
166+
path: '/login'
167+
fullPath: '/login'
168+
preLoaderRoute: typeof LoginRouteImport
169+
parentRoute: typeof rootRouteImport
94170
}
95-
'/_layout/admin': {
96-
preLoaderRoute: typeof LayoutAdminImport
97-
parentRoute: typeof LayoutImport
171+
'/_layout': {
172+
id: '/_layout'
173+
path: ''
174+
fullPath: ''
175+
preLoaderRoute: typeof LayoutRouteImport
176+
parentRoute: typeof rootRouteImport
98177
}
99-
'/_layout/items': {
100-
preLoaderRoute: typeof LayoutItemsImport
101-
parentRoute: typeof LayoutImport
178+
'/_layout/': {
179+
id: '/_layout/'
180+
path: '/'
181+
fullPath: '/'
182+
preLoaderRoute: typeof LayoutIndexRouteImport
183+
parentRoute: typeof LayoutRoute
102184
}
103185
'/_layout/settings': {
104-
preLoaderRoute: typeof LayoutSettingsImport
105-
parentRoute: typeof LayoutImport
186+
id: '/_layout/settings'
187+
path: '/settings'
188+
fullPath: '/settings'
189+
preLoaderRoute: typeof LayoutSettingsRouteImport
190+
parentRoute: typeof LayoutRoute
106191
}
107-
'/_layout/': {
108-
preLoaderRoute: typeof LayoutIndexImport
109-
parentRoute: typeof LayoutImport
192+
'/_layout/items': {
193+
id: '/_layout/items'
194+
path: '/items'
195+
fullPath: '/items'
196+
preLoaderRoute: typeof LayoutItemsRouteImport
197+
parentRoute: typeof LayoutRoute
198+
}
199+
'/_layout/admin': {
200+
id: '/_layout/admin'
201+
path: '/admin'
202+
fullPath: '/admin'
203+
preLoaderRoute: typeof LayoutAdminRouteImport
204+
parentRoute: typeof LayoutRoute
110205
}
111206
}
112207
}
113208

114-
// Create and export the route tree
209+
interface LayoutRouteChildren {
210+
LayoutAdminRoute: typeof LayoutAdminRoute
211+
LayoutItemsRoute: typeof LayoutItemsRoute
212+
LayoutSettingsRoute: typeof LayoutSettingsRoute
213+
LayoutIndexRoute: typeof LayoutIndexRoute
214+
}
215+
216+
const LayoutRouteChildren: LayoutRouteChildren = {
217+
LayoutAdminRoute: LayoutAdminRoute,
218+
LayoutItemsRoute: LayoutItemsRoute,
219+
LayoutSettingsRoute: LayoutSettingsRoute,
220+
LayoutIndexRoute: LayoutIndexRoute,
221+
}
115222

116-
export const routeTree = rootRoute.addChildren([
117-
LayoutRoute.addChildren([
118-
LayoutAdminRoute,
119-
LayoutItemsRoute,
120-
LayoutSettingsRoute,
121-
LayoutIndexRoute,
122-
]),
123-
LoginRoute,
124-
RecoverPasswordRoute,
125-
ResetPasswordRoute,
126-
SignupRoute,
127-
])
223+
const LayoutRouteWithChildren =
224+
LayoutRoute._addFileChildren(LayoutRouteChildren)
128225

129-
/* prettier-ignore-end */
226+
const rootRouteChildren: RootRouteChildren = {
227+
LayoutRoute: LayoutRouteWithChildren,
228+
LoginRoute: LoginRoute,
229+
RecoverPasswordRoute: RecoverPasswordRoute,
230+
ResetPasswordRoute: ResetPasswordRoute,
231+
SignupRoute: SignupRoute,
232+
}
233+
export const routeTree = rootRouteImport
234+
._addFileChildren(rootRouteChildren)
235+
._addFileTypes<FileRouteTypes>()

frontend/src/routes/_layout/admin.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ function UsersTable() {
4444
placeholderData: (prevData) => prevData,
4545
})
4646

47-
const setPage = (page: number) =>
47+
const setPage = (page: number) => {
4848
navigate({
49-
search: (prev: { [key: string]: string }) => ({ ...prev, String(page) }),
49+
to: "/_layout/admin",
50+
search: { page: page },
5051
})
52+
}
5153

5254
const users = data?.data.slice(0, PER_PAGE) ?? []
5355
const count = data?.count ?? 0

frontend/src/routes/_layout/items.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ function ItemsTable() {
5050
placeholderData: (prevData) => prevData,
5151
})
5252

53-
const setPage = (page: number) =>
53+
const setPage = (page: number) => {
5454
navigate({
55-
search: (prev: { [key: string]: string }) => ({ ...prev, String(page) }),
55+
to: "/_layout/items",
56+
search: { page: page },
5657
})
58+
}
5759

5860
const items = data?.data.slice(0, PER_PAGE) ?? []
5961
const count = data?.count ?? 0

0 commit comments

Comments
 (0)