Skip to content

Commit

Permalink
fix: final to keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ollibowers committed Nov 14, 2024
1 parent ba23cfc commit 046ba07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions frontend/src/pages/LoginSuccess/LoginSuccess.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ const LoginSuccess = () => {

dispatch(updateIdentityWithAPIRes(identity));
const userIsSetup = await queryClient.fetchQuery({
queryKey: ['isSetup'], // TODO-OLLI(pm): fix this key
queryFn: () => getUserIsSetup(identity.session_token)
queryKey: ['user', identity.uid, 'isSetup'], // HAS TO MATCH queries.ts
queryFn: () => getUserIsSetup(identity.session_token),
staleTime: 1000 * 60 * 5 // 5 minutes
});

navigate(userIsSetup ? '/course-selector' : '/degree-wizard', { replace: true });
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/pages/TermPlanner/TermPlanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,15 @@ const TermPlanner = () => {
// comes in as an { [year]: course }[], which gets auto extrapolated, also preseeded with bad data
const courseQueries = useQueries({
queries: Object.keys(courses).map((code: string) => ({
queryKey: ['course', code, { years: validYears }],
queryKey: ['courses', code, 'multiinfo', { years: validYears }],
queryFn: () =>
getCourseForYearsInfo(
code,
validYears.filter((year) => year < LIVE_YEAR)
),
select: (data: Record<number, Course>) => extrapolateCourseYears(data, validYears),
staleTime: Infinity,
gcTime: 1000 * 60 * 15, // 15 minutes
placeholderData: badCourseYears(code, validYears)
}))
});
Expand Down

0 comments on commit 046ba07

Please sign in to comment.