diff --git a/src/models/GenericModel.ts b/src/models/GenericModel.ts index 46daf54..7cc48e8 100644 --- a/src/models/GenericModel.ts +++ b/src/models/GenericModel.ts @@ -8,5 +8,6 @@ export default abstract class GenericModel { // Abstract method for parsing JSON static parseJson(json: any): GenericModel { throw new Error("parseJson method not implemented."); + return json } } diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts index e4b276f..4137013 100644 --- a/src/routeTree.gen.ts +++ b/src/routeTree.gen.ts @@ -15,6 +15,7 @@ import { Route as LoginImport } from './routes/login' import { Route as IndexImport } from './routes/index' import { Route as SalesIndexImport } from './routes/sales/index' import { Route as MapIndexImport } from './routes/map/index' +import { Route as HomeIndexImport } from './routes/home/index' import { Route as EventsIndexImport } from './routes/events/index' import { Route as DinnerIndexImport } from './routes/dinner/index' import { Route as CalendarIndexImport } from './routes/calendar/index' @@ -44,6 +45,11 @@ const MapIndexRoute = MapIndexImport.update({ getParentRoute: () => rootRoute, } as any) +const HomeIndexRoute = HomeIndexImport.update({ + path: '/home/', + getParentRoute: () => rootRoute, +} as any) + const EventsIndexRoute = EventsIndexImport.update({ path: '/events/', getParentRoute: () => rootRoute, @@ -134,6 +140,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof EventsIndexImport parentRoute: typeof rootRoute } + '/home/': { + id: '/home/' + path: '/home' + fullPath: '/home' + preLoaderRoute: typeof HomeIndexImport + parentRoute: typeof rootRoute + } '/map/': { id: '/map/' path: '/map' @@ -162,6 +175,7 @@ export interface FileRoutesByFullPath { '/calendar': typeof CalendarIndexRoute '/dinner': typeof DinnerIndexRoute '/events': typeof EventsIndexRoute + '/home': typeof HomeIndexRoute '/map': typeof MapIndexRoute '/sales': typeof SalesIndexRoute } @@ -175,6 +189,7 @@ export interface FileRoutesByTo { '/calendar': typeof CalendarIndexRoute '/dinner': typeof DinnerIndexRoute '/events': typeof EventsIndexRoute + '/home': typeof HomeIndexRoute '/map': typeof MapIndexRoute '/sales': typeof SalesIndexRoute } @@ -189,6 +204,7 @@ export interface FileRoutesById { '/calendar/': typeof CalendarIndexRoute '/dinner/': typeof DinnerIndexRoute '/events/': typeof EventsIndexRoute + '/home/': typeof HomeIndexRoute '/map/': typeof MapIndexRoute '/sales/': typeof SalesIndexRoute } @@ -204,6 +220,7 @@ export interface FileRouteTypes { | '/calendar' | '/dinner' | '/events' + | '/home' | '/map' | '/sales' fileRoutesByTo: FileRoutesByTo @@ -216,6 +233,7 @@ export interface FileRouteTypes { | '/calendar' | '/dinner' | '/events' + | '/home' | '/map' | '/sales' id: @@ -228,6 +246,7 @@ export interface FileRouteTypes { | '/calendar/' | '/dinner/' | '/events/' + | '/home/' | '/map/' | '/sales/' fileRoutesById: FileRoutesById @@ -242,6 +261,7 @@ export interface RootRouteChildren { CalendarIndexRoute: typeof CalendarIndexRoute DinnerIndexRoute: typeof DinnerIndexRoute EventsIndexRoute: typeof EventsIndexRoute + HomeIndexRoute: typeof HomeIndexRoute MapIndexRoute: typeof MapIndexRoute SalesIndexRoute: typeof SalesIndexRoute } @@ -255,6 +275,7 @@ const rootRouteChildren: RootRouteChildren = { CalendarIndexRoute: CalendarIndexRoute, DinnerIndexRoute: DinnerIndexRoute, EventsIndexRoute: EventsIndexRoute, + HomeIndexRoute: HomeIndexRoute, MapIndexRoute: MapIndexRoute, SalesIndexRoute: SalesIndexRoute, } @@ -279,6 +300,7 @@ export const routeTree = rootRoute "/calendar/", "/dinner/", "/events/", + "/home/", "/map/", "/sales/" ] @@ -307,6 +329,9 @@ export const routeTree = rootRoute "/events/": { "filePath": "events/index.tsx" }, + "/home/": { + "filePath": "home/index.tsx" + }, "/map/": { "filePath": "map/index.tsx" }, diff --git a/src/routes/home/index.tsx b/src/routes/home/index.tsx index 2e358c7..8cf6ea8 100644 --- a/src/routes/home/index.tsx +++ b/src/routes/home/index.tsx @@ -1,19 +1,19 @@ import { createFileRoute } from '@tanstack/react-router' -import { VStack } from '../../components' - -const homeItems = [ - { title: "test", description: "Hello world." }, - { title: "test", description: "Hello world." }, - { title: "test", description: "Hello world." }, - { title: "test", description: "Hello world." }, - { title: "test", description: "Hello world." }, - { title: "test", description: "Hello world." }, - { title: "test", description: "Hello world." }, - { title: "test", description: "Hello world." }, - { title: "test", description: "Hello world." }, - { title: "test", description: "Hello world." }, - { title: "test", description: "Hello world." }, -] +// import { VStack } from '../../components' + +// const homeItems = [ +// { title: "test", description: "Hello world." }, +// { title: "test", description: "Hello world." }, +// { title: "test", description: "Hello world." }, +// { title: "test", description: "Hello world." }, +// { title: "test", description: "Hello world." }, +// { title: "test", description: "Hello world." }, +// { title: "test", description: "Hello world." }, +// { title: "test", description: "Hello world." }, +// { title: "test", description: "Hello world." }, +// { title: "test", description: "Hello world." }, +// { title: "test", description: "Hello world." }, +// ] // User.fetchSingle().then(user => { // console.log(user) @@ -67,23 +67,5 @@ export const Route = createFileRoute('/home/')({ 變更個人檔案 - - - - - {/* {homeItems.map((item, index) => ( - - ))} */} - - {/* - - - Hello - - - X - - Test */} - - , + , })