Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-06-30 20:44:47 +00:00
co-authored by renee-png
parent eeeae5181a
commit 002f4d00f0
2 changed files with 192 additions and 4 deletions
+187 -2
View File
@@ -12,7 +12,15 @@ import { Route as rootRouteImport } from './routes/__root'
import { Route as AuthRouteImport } from './routes/auth' import { Route as AuthRouteImport } from './routes/auth'
import { Route as AuthenticatedRouteRouteImport } from './routes/_authenticated/route' import { Route as AuthenticatedRouteRouteImport } from './routes/_authenticated/route'
import { Route as IndexRouteImport } from './routes/index' import { Route as IndexRouteImport } from './routes/index'
import { Route as AuthenticatedStudentsRouteImport } from './routes/_authenticated/students'
import { Route as AuthenticatedMessagesRouteImport } from './routes/_authenticated/messages'
import { Route as AuthenticatedLedgerRouteImport } from './routes/_authenticated/ledger'
import { Route as AuthenticatedFormsRouteImport } from './routes/_authenticated/forms'
import { Route as AuthenticatedDashboardRouteImport } from './routes/_authenticated/dashboard' import { Route as AuthenticatedDashboardRouteImport } from './routes/_authenticated/dashboard'
import { Route as AuthenticatedCalendarRouteImport } from './routes/_authenticated/calendar'
import { Route as AuthenticatedAttendanceRouteImport } from './routes/_authenticated/attendance'
import { Route as AuthenticatedAdminRouteImport } from './routes/_authenticated/admin'
import { Route as AuthenticatedStudentsIdRouteImport } from './routes/_authenticated/students.$id'
const AuthRoute = AuthRouteImport.update({ const AuthRoute = AuthRouteImport.update({
id: '/auth', id: '/auth',
@@ -28,40 +36,134 @@ const IndexRoute = IndexRouteImport.update({
path: '/', path: '/',
getParentRoute: () => rootRouteImport, getParentRoute: () => rootRouteImport,
} as any) } as any)
const AuthenticatedStudentsRoute = AuthenticatedStudentsRouteImport.update({
id: '/students',
path: '/students',
getParentRoute: () => AuthenticatedRouteRoute,
} as any)
const AuthenticatedMessagesRoute = AuthenticatedMessagesRouteImport.update({
id: '/messages',
path: '/messages',
getParentRoute: () => AuthenticatedRouteRoute,
} as any)
const AuthenticatedLedgerRoute = AuthenticatedLedgerRouteImport.update({
id: '/ledger',
path: '/ledger',
getParentRoute: () => AuthenticatedRouteRoute,
} as any)
const AuthenticatedFormsRoute = AuthenticatedFormsRouteImport.update({
id: '/forms',
path: '/forms',
getParentRoute: () => AuthenticatedRouteRoute,
} as any)
const AuthenticatedDashboardRoute = AuthenticatedDashboardRouteImport.update({ const AuthenticatedDashboardRoute = AuthenticatedDashboardRouteImport.update({
id: '/dashboard', id: '/dashboard',
path: '/dashboard', path: '/dashboard',
getParentRoute: () => AuthenticatedRouteRoute, getParentRoute: () => AuthenticatedRouteRoute,
} as any) } as any)
const AuthenticatedCalendarRoute = AuthenticatedCalendarRouteImport.update({
id: '/calendar',
path: '/calendar',
getParentRoute: () => AuthenticatedRouteRoute,
} as any)
const AuthenticatedAttendanceRoute = AuthenticatedAttendanceRouteImport.update({
id: '/attendance',
path: '/attendance',
getParentRoute: () => AuthenticatedRouteRoute,
} as any)
const AuthenticatedAdminRoute = AuthenticatedAdminRouteImport.update({
id: '/admin',
path: '/admin',
getParentRoute: () => AuthenticatedRouteRoute,
} as any)
const AuthenticatedStudentsIdRoute = AuthenticatedStudentsIdRouteImport.update({
id: '/$id',
path: '/$id',
getParentRoute: () => AuthenticatedStudentsRoute,
} as any)
export interface FileRoutesByFullPath { export interface FileRoutesByFullPath {
'/': typeof IndexRoute '/': typeof IndexRoute
'/auth': typeof AuthRoute '/auth': typeof AuthRoute
'/admin': typeof AuthenticatedAdminRoute
'/attendance': typeof AuthenticatedAttendanceRoute
'/calendar': typeof AuthenticatedCalendarRoute
'/dashboard': typeof AuthenticatedDashboardRoute '/dashboard': typeof AuthenticatedDashboardRoute
'/forms': typeof AuthenticatedFormsRoute
'/ledger': typeof AuthenticatedLedgerRoute
'/messages': typeof AuthenticatedMessagesRoute
'/students': typeof AuthenticatedStudentsRouteWithChildren
'/students/$id': typeof AuthenticatedStudentsIdRoute
} }
export interface FileRoutesByTo { export interface FileRoutesByTo {
'/': typeof IndexRoute '/': typeof IndexRoute
'/auth': typeof AuthRoute '/auth': typeof AuthRoute
'/admin': typeof AuthenticatedAdminRoute
'/attendance': typeof AuthenticatedAttendanceRoute
'/calendar': typeof AuthenticatedCalendarRoute
'/dashboard': typeof AuthenticatedDashboardRoute '/dashboard': typeof AuthenticatedDashboardRoute
'/forms': typeof AuthenticatedFormsRoute
'/ledger': typeof AuthenticatedLedgerRoute
'/messages': typeof AuthenticatedMessagesRoute
'/students': typeof AuthenticatedStudentsRouteWithChildren
'/students/$id': typeof AuthenticatedStudentsIdRoute
} }
export interface FileRoutesById { export interface FileRoutesById {
__root__: typeof rootRouteImport __root__: typeof rootRouteImport
'/': typeof IndexRoute '/': typeof IndexRoute
'/_authenticated': typeof AuthenticatedRouteRouteWithChildren '/_authenticated': typeof AuthenticatedRouteRouteWithChildren
'/auth': typeof AuthRoute '/auth': typeof AuthRoute
'/_authenticated/admin': typeof AuthenticatedAdminRoute
'/_authenticated/attendance': typeof AuthenticatedAttendanceRoute
'/_authenticated/calendar': typeof AuthenticatedCalendarRoute
'/_authenticated/dashboard': typeof AuthenticatedDashboardRoute '/_authenticated/dashboard': typeof AuthenticatedDashboardRoute
'/_authenticated/forms': typeof AuthenticatedFormsRoute
'/_authenticated/ledger': typeof AuthenticatedLedgerRoute
'/_authenticated/messages': typeof AuthenticatedMessagesRoute
'/_authenticated/students': typeof AuthenticatedStudentsRouteWithChildren
'/_authenticated/students/$id': typeof AuthenticatedStudentsIdRoute
} }
export interface FileRouteTypes { export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath fileRoutesByFullPath: FileRoutesByFullPath
fullPaths: '/' | '/auth' | '/dashboard' fullPaths:
| '/'
| '/auth'
| '/admin'
| '/attendance'
| '/calendar'
| '/dashboard'
| '/forms'
| '/ledger'
| '/messages'
| '/students'
| '/students/$id'
fileRoutesByTo: FileRoutesByTo fileRoutesByTo: FileRoutesByTo
to: '/' | '/auth' | '/dashboard' to:
| '/'
| '/auth'
| '/admin'
| '/attendance'
| '/calendar'
| '/dashboard'
| '/forms'
| '/ledger'
| '/messages'
| '/students'
| '/students/$id'
id: id:
| '__root__' | '__root__'
| '/' | '/'
| '/_authenticated' | '/_authenticated'
| '/auth' | '/auth'
| '/_authenticated/admin'
| '/_authenticated/attendance'
| '/_authenticated/calendar'
| '/_authenticated/dashboard' | '/_authenticated/dashboard'
| '/_authenticated/forms'
| '/_authenticated/ledger'
| '/_authenticated/messages'
| '/_authenticated/students'
| '/_authenticated/students/$id'
fileRoutesById: FileRoutesById fileRoutesById: FileRoutesById
} }
export interface RootRouteChildren { export interface RootRouteChildren {
@@ -93,6 +195,34 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof IndexRouteImport preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport parentRoute: typeof rootRouteImport
} }
'/_authenticated/students': {
id: '/_authenticated/students'
path: '/students'
fullPath: '/students'
preLoaderRoute: typeof AuthenticatedStudentsRouteImport
parentRoute: typeof AuthenticatedRouteRoute
}
'/_authenticated/messages': {
id: '/_authenticated/messages'
path: '/messages'
fullPath: '/messages'
preLoaderRoute: typeof AuthenticatedMessagesRouteImport
parentRoute: typeof AuthenticatedRouteRoute
}
'/_authenticated/ledger': {
id: '/_authenticated/ledger'
path: '/ledger'
fullPath: '/ledger'
preLoaderRoute: typeof AuthenticatedLedgerRouteImport
parentRoute: typeof AuthenticatedRouteRoute
}
'/_authenticated/forms': {
id: '/_authenticated/forms'
path: '/forms'
fullPath: '/forms'
preLoaderRoute: typeof AuthenticatedFormsRouteImport
parentRoute: typeof AuthenticatedRouteRoute
}
'/_authenticated/dashboard': { '/_authenticated/dashboard': {
id: '/_authenticated/dashboard' id: '/_authenticated/dashboard'
path: '/dashboard' path: '/dashboard'
@@ -100,15 +230,70 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof AuthenticatedDashboardRouteImport preLoaderRoute: typeof AuthenticatedDashboardRouteImport
parentRoute: typeof AuthenticatedRouteRoute parentRoute: typeof AuthenticatedRouteRoute
} }
'/_authenticated/calendar': {
id: '/_authenticated/calendar'
path: '/calendar'
fullPath: '/calendar'
preLoaderRoute: typeof AuthenticatedCalendarRouteImport
parentRoute: typeof AuthenticatedRouteRoute
}
'/_authenticated/attendance': {
id: '/_authenticated/attendance'
path: '/attendance'
fullPath: '/attendance'
preLoaderRoute: typeof AuthenticatedAttendanceRouteImport
parentRoute: typeof AuthenticatedRouteRoute
}
'/_authenticated/admin': {
id: '/_authenticated/admin'
path: '/admin'
fullPath: '/admin'
preLoaderRoute: typeof AuthenticatedAdminRouteImport
parentRoute: typeof AuthenticatedRouteRoute
}
'/_authenticated/students/$id': {
id: '/_authenticated/students/$id'
path: '/$id'
fullPath: '/students/$id'
preLoaderRoute: typeof AuthenticatedStudentsIdRouteImport
parentRoute: typeof AuthenticatedStudentsRoute
}
} }
} }
interface AuthenticatedStudentsRouteChildren {
AuthenticatedStudentsIdRoute: typeof AuthenticatedStudentsIdRoute
}
const AuthenticatedStudentsRouteChildren: AuthenticatedStudentsRouteChildren = {
AuthenticatedStudentsIdRoute: AuthenticatedStudentsIdRoute,
}
const AuthenticatedStudentsRouteWithChildren =
AuthenticatedStudentsRoute._addFileChildren(
AuthenticatedStudentsRouteChildren,
)
interface AuthenticatedRouteRouteChildren { interface AuthenticatedRouteRouteChildren {
AuthenticatedAdminRoute: typeof AuthenticatedAdminRoute
AuthenticatedAttendanceRoute: typeof AuthenticatedAttendanceRoute
AuthenticatedCalendarRoute: typeof AuthenticatedCalendarRoute
AuthenticatedDashboardRoute: typeof AuthenticatedDashboardRoute AuthenticatedDashboardRoute: typeof AuthenticatedDashboardRoute
AuthenticatedFormsRoute: typeof AuthenticatedFormsRoute
AuthenticatedLedgerRoute: typeof AuthenticatedLedgerRoute
AuthenticatedMessagesRoute: typeof AuthenticatedMessagesRoute
AuthenticatedStudentsRoute: typeof AuthenticatedStudentsRouteWithChildren
} }
const AuthenticatedRouteRouteChildren: AuthenticatedRouteRouteChildren = { const AuthenticatedRouteRouteChildren: AuthenticatedRouteRouteChildren = {
AuthenticatedAdminRoute: AuthenticatedAdminRoute,
AuthenticatedAttendanceRoute: AuthenticatedAttendanceRoute,
AuthenticatedCalendarRoute: AuthenticatedCalendarRoute,
AuthenticatedDashboardRoute: AuthenticatedDashboardRoute, AuthenticatedDashboardRoute: AuthenticatedDashboardRoute,
AuthenticatedFormsRoute: AuthenticatedFormsRoute,
AuthenticatedLedgerRoute: AuthenticatedLedgerRoute,
AuthenticatedMessagesRoute: AuthenticatedMessagesRoute,
AuthenticatedStudentsRoute: AuthenticatedStudentsRouteWithChildren,
} }
const AuthenticatedRouteRouteWithChildren = const AuthenticatedRouteRouteWithChildren =
+5 -2
View File
@@ -105,8 +105,11 @@ function ClassesTab() {
const { data: teachers } = useQuery({ const { data: teachers } = useQuery({
queryKey: ["teachers"], queryKey: ["teachers"],
queryFn: async () => { queryFn: async () => {
const { data } = await supabase.from("user_roles").select("user_id, profiles(id, full_name, email)").eq("role", "teacher"); const { data: r } = await supabase.from("user_roles").select("user_id").eq("role", "teacher");
return (data ?? []).map((d) => d.profiles as { id: string; full_name: string; email: string }).filter(Boolean); const ids = (r ?? []).map((x) => x.user_id);
if (ids.length === 0) return [];
const { data } = await supabase.from("profiles").select("id, full_name, email").in("id", ids);
return data ?? [];
}, },
}); });