diff --git a/frontend/src/i18n/locale/de.json b/frontend/src/i18n/locale/de.json index 15975e97..3988575d 100644 --- a/frontend/src/i18n/locale/de.json +++ b/frontend/src/i18n/locale/de.json @@ -82,5 +82,7 @@ "reject": "zurückweisen", "areusure": "Sind Sie sicher?", "yes": "ja", - "teachers": "Lehrer" + "teachers": "Lehrer", + "rejected": "abgelehnt", + "accepted": "akzeptiert" } diff --git a/frontend/src/i18n/locale/en.json b/frontend/src/i18n/locale/en.json index 76a9bcf2..630790ad 100644 --- a/frontend/src/i18n/locale/en.json +++ b/frontend/src/i18n/locale/en.json @@ -82,5 +82,7 @@ "reject": "reject", "areusure": "Are you sure?", "yes": "yes", - "teachers": "teachers" + "teachers": "teachers", + "accepted": "accepted", + "rejected": "rejected" } diff --git a/frontend/src/i18n/locale/fr.json b/frontend/src/i18n/locale/fr.json index d5eed78a..777d0a9a 100644 --- a/frontend/src/i18n/locale/fr.json +++ b/frontend/src/i18n/locale/fr.json @@ -82,5 +82,7 @@ "reject": "rejeter", "areusure": "Êtes-vous sûr?", "yes": "oui", - "teachers": "enseignants" + "teachers": "enseignants", + "accepted": "acceptée", + "rejected": "rejetée" } diff --git a/frontend/src/i18n/locale/nl.json b/frontend/src/i18n/locale/nl.json index 1c2b2b37..754592cd 100644 --- a/frontend/src/i18n/locale/nl.json +++ b/frontend/src/i18n/locale/nl.json @@ -82,5 +82,7 @@ "reject": "weiger", "areusure": "Bent u zeker?", "yes": "ja", - "teachers": "leerkrachten" + "teachers": "leerkrachten", + "accepted": "geaccepteerd", + "rejected": "geweigerd" } diff --git a/frontend/src/queries/teachers.ts b/frontend/src/queries/teachers.ts index 3e77f819..59da84f4 100644 --- a/frontend/src/queries/teachers.ts +++ b/frontend/src/queries/teachers.ts @@ -137,7 +137,7 @@ export function useUpdateJoinRequestMutation(): UseMutationReturnType< mutationFn: async ({ teacherUsername, classId, studentUsername, accepted }) => teacherController.updateStudentJoinRequest(teacherUsername, classId, studentUsername, accepted), onSuccess: async (deletedJoinRequest) => { - const username = deletedJoinRequest.request.requester; + const username = deletedJoinRequest.request.requester.username; const classId = deletedJoinRequest.request.class; await queryClient.invalidateQueries({ queryKey: studentJoinRequestsQueryKey(username) }); await queryClient.invalidateQueries({ queryKey: studentJoinRequestQueryKey(username, classId) }); diff --git a/frontend/src/views/classes/SingleClass.vue b/frontend/src/views/classes/SingleClass.vue index 0e165fa3..196115e2 100644 --- a/frontend/src/views/classes/SingleClass.vue +++ b/frontend/src/views/classes/SingleClass.vue @@ -61,8 +61,16 @@ accepted: accepted, }, { - onSuccess: () => { - showSnackbar(t("sent"), "success"); + onSuccess: async () => { + if (accepted){ + await joinRequestsQuery.refetch(); + await getStudents.refetch(); + + showSnackbar(t("accepted"), "success"); + } else { + await joinRequestsQuery.refetch(); + showSnackbar(t("rejected"), "success"); + } }, onError: (e) => { showSnackbar(t("failed") + ": " + e.message, "error");