diff --git a/src/app/layouts/RootLayout.tsx b/src/app/layouts/RootLayout.tsx index aa4d97b..31ed5ef 100644 --- a/src/app/layouts/RootLayout.tsx +++ b/src/app/layouts/RootLayout.tsx @@ -34,6 +34,7 @@ const adminWorkspaceRoutes = [ routePaths.adminInternships, routePaths.adminCandidateFiltering, routePaths.adminShortlists, + routePaths.adminEligibleStudents, ] as const function isAdminWorkspacePath(pathname: string) { diff --git a/src/features/eligible-students/hooks/useEligibleStudents.ts b/src/features/eligible-students/hooks/useEligibleStudents.ts index 978c3a8..6fc1149 100644 --- a/src/features/eligible-students/hooks/useEligibleStudents.ts +++ b/src/features/eligible-students/hooks/useEligibleStudents.ts @@ -1,4 +1,5 @@ import { keepPreviousData, useMutation, useQuery, useQueryClient } from '@tanstack/react-query' +import { adminDashboardKeys } from '../../admin-dashboard/hooks/adminDashboardQueryKeys' import { eligibleStudentsApi } from '../api/eligibleStudentsApi' import type { EligibleStudentQuery, EligibleStudentRequest } from '../types/eligibleStudentTypes' @@ -17,7 +18,12 @@ export function useEligibleStudents(query: EligibleStudentQuery) { export function useEligibleStudentMutations() { const queryClient = useQueryClient() - const refresh = () => queryClient.invalidateQueries({ queryKey: keys.all }) + const refresh = () => { + void queryClient.invalidateQueries({ queryKey: keys.all }) + // The Admin Dashboard's "Total Students" / "Registered Students" metrics are derived from the + // eligible-students roster, so they go stale the moment a roster entry is added or removed. + return queryClient.invalidateQueries({ queryKey: adminDashboardKeys.all }) + } return { create: useMutation({ mutationFn: (values: EligibleStudentRequest) => eligibleStudentsApi.create(values), diff --git a/src/features/student-profile/components/ProfileIdentityCard.tsx b/src/features/student-profile/components/ProfileIdentityCard.tsx index 838f542..29fefec 100644 --- a/src/features/student-profile/components/ProfileIdentityCard.tsx +++ b/src/features/student-profile/components/ProfileIdentityCard.tsx @@ -39,7 +39,7 @@ export function ProfileIdentityCard({