fix: invalideren cache key bij klas
This commit is contained in:
parent
c054eb9335
commit
17460684aa
2 changed files with 4 additions and 1 deletions
|
@ -15,6 +15,7 @@ import { invalidateAllGroupKeys } from "./groups";
|
||||||
import { invalidateAllSubmissionKeys } from "./submissions";
|
import { invalidateAllSubmissionKeys } from "./submissions";
|
||||||
import type { TeachersResponse } from "@/controllers/teachers";
|
import type { TeachersResponse } from "@/controllers/teachers";
|
||||||
import type { TeacherInvitationsResponse } from "@/controllers/teacher-invitations";
|
import type { TeacherInvitationsResponse } from "@/controllers/teacher-invitations";
|
||||||
|
import {studentClassesQueryKey} from "@/queries/students.ts";
|
||||||
|
|
||||||
const classController = new ClassController();
|
const classController = new ClassController();
|
||||||
|
|
||||||
|
@ -171,6 +172,8 @@ export function useClassDeleteStudentMutation(): UseMutationReturnType<
|
||||||
await queryClient.invalidateQueries({ queryKey: classQueryKey(data.class.id) });
|
await queryClient.invalidateQueries({ queryKey: classQueryKey(data.class.id) });
|
||||||
await queryClient.invalidateQueries({ queryKey: classStudentsKey(data.class.id, true) });
|
await queryClient.invalidateQueries({ queryKey: classStudentsKey(data.class.id, true) });
|
||||||
await queryClient.invalidateQueries({ queryKey: classStudentsKey(data.class.id, false) });
|
await queryClient.invalidateQueries({ queryKey: classStudentsKey(data.class.id, false) });
|
||||||
|
await queryClient.invalidateQueries({ queryKey: studentClassesQueryKey(data.class.id, false) });
|
||||||
|
await queryClient.invalidateQueries({ queryKey: studentClassesQueryKey(data.class.id, true) });
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ function studentsQueryKey(full: boolean): [string, boolean] {
|
||||||
function studentQueryKey(username: string): [string, string] {
|
function studentQueryKey(username: string): [string, string] {
|
||||||
return ["student", username];
|
return ["student", username];
|
||||||
}
|
}
|
||||||
function studentClassesQueryKey(username: string, full: boolean): [string, string, boolean] {
|
export function studentClassesQueryKey(username: string, full: boolean): [string, string, boolean] {
|
||||||
return ["student-classes", username, full];
|
return ["student-classes", username, full];
|
||||||
}
|
}
|
||||||
function studentAssignmentsQueryKey(username: string, full: boolean): [string, string, boolean] {
|
function studentAssignmentsQueryKey(username: string, full: boolean): [string, string, boolean] {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue