diff --git a/frontend/src/queries/students.ts b/frontend/src/queries/students.ts index 9caa385b..aaf05544 100644 --- a/frontend/src/queries/students.ts +++ b/frontend/src/queries/students.ts @@ -27,7 +27,7 @@ export function useStudentQuery(username: MaybeRefOrGetter) return useQuery({ queryKey: computed(() => STUDENT_QUERY_KEY(toValue(username)!)), queryFn: () => studentController.getByUsername(toValue(username)!), - enabled: () => !!toValue(username), + enabled: () => Boolean(toValue(username)), }); } @@ -35,7 +35,7 @@ export function useStudentClassesQuery(username: MaybeRefOrGetter STUDENT_CLASSES_QUERY_KEY(toValue(username)!, toValue(full))), queryFn: () => studentController.getClasses(toValue(username)!, toValue(full)), - enabled: () => !!toValue(username), + enabled: () => Boolean(toValue(username)), }); } @@ -43,7 +43,7 @@ export function useStudentAssignmentsQuery(username: MaybeRefOrGetter STUDENT_ASSIGNMENTS_QUERY_KEY(toValue(username)!, toValue(full))), queryFn: () => studentController.getAssignments(toValue(username)!, toValue(full)), - enabled: () => !!toValue(username), + enabled: () => Boolean(toValue(username)), }); } @@ -51,7 +51,7 @@ export function useStudentGroupsQuery(username: MaybeRefOrGetter STUDENT_GROUPS_QUERY_KEY(toValue(username)!, toValue(full))), queryFn: () => studentController.getGroups(toValue(username)!, toValue(full)), - enabled: () => !!toValue(username), + enabled: () => Boolean(toValue(username)), }); } @@ -59,7 +59,7 @@ export function useStudentSubmissionsQuery(username: MaybeRefOrGetter STUDENT_SUBMISSIONS_QUERY_KEY(toValue(username)!)), queryFn: () => studentController.getSubmissions(toValue(username)!), - enabled: () => !!toValue(username), + enabled: () => Boolean(toValue(username)), }); } @@ -67,7 +67,7 @@ export function useStudentQuestionsQuery(username: MaybeRefOrGetter STUDENT_QUESTIONS_QUERY_KEY(toValue(username)!, toValue(full))), queryFn: () => studentController.getQuestions(toValue(username)!, toValue(full)), - enabled: () => !!toValue(username), + enabled: () => Boolean(toValue(username)), }); } @@ -86,8 +86,8 @@ export function useCreateStudentMutation() { } // TODO -// setquerydata -// previous students +// Setquerydata +// Previous students export function useDeleteStudentMutation() { const queryClient = useQueryClient(); @@ -106,7 +106,7 @@ export function useStudentJoinRequestsQuery(username: MaybeRefOrGetter STUDENT_JOIN_REQUESTS_QUERY_KEY(toValue(username)!)), queryFn: () => studentController.getJoinRequests(toValue(username)!), - enabled: () => !!toValue(username), + enabled: () => Boolean(toValue(username)), }); } diff --git a/frontend/src/queries/teachers.ts b/frontend/src/queries/teachers.ts index 852d971e..2df0eeec 100644 --- a/frontend/src/queries/teachers.ts +++ b/frontend/src/queries/teachers.ts @@ -24,7 +24,7 @@ export function useTeacherQuery(username: MaybeRefOrGetter) return useQuery({ queryKey: computed(() => TEACHER_QUERY_KEY(toValue(username)!)), queryFn: () => teacherController.getByUsername(toValue(username)!), - enabled: () => !!toValue(username), + enabled: () => Boolean(toValue(username)), }); } @@ -32,7 +32,7 @@ export function useTeacherClassesQuery(username: MaybeRefOrGetter TEACHER_CLASSES_QUERY_KEY(toValue(username)!, toValue(full))), queryFn: () => teacherController.getClasses(toValue(username)!, toValue(full)), - enabled: () => !!toValue(username), + enabled: () => Boolean(toValue(username)), }); } @@ -40,7 +40,7 @@ export function useTeacherStudentsQuery(username: MaybeRefOrGetter TEACHER_STUDENTS_QUERY_KEY(toValue(username)!, toValue(full))), queryFn: () => teacherController.getStudents(toValue(username)!, toValue(full)), - enabled: () => !!toValue(username), + enabled: () => Boolean(toValue(username)), }); } @@ -48,7 +48,7 @@ export function useTeacherQuestionsQuery(username: MaybeRefOrGetter TEACHER_QUESTIONS_QUERY_KEY(toValue(username)!, toValue(full))), queryFn: () => teacherController.getQuestions(toValue(username)!, toValue(full)), - enabled: () => !!toValue(username), + enabled: () => Boolean(toValue(username)), }); } @@ -56,7 +56,7 @@ export function useTeacherJoinRequestsQuery(username: MaybeRefOrGetter JOIN_REQUESTS_QUERY_KEY(toValue(username)!, toValue(classId)!)), queryFn: () => teacherController.getStudentJoinRequests(toValue(username)!, toValue(classId)!), - enabled: () => !!toValue(username) && !!toValue(classId), + enabled: () => Boolean(toValue(username)) && Boolean(toValue(classId)), }); }