From b0849addfd79b4b5fd698898c6585df736730080 Mon Sep 17 00:00:00 2001 From: Reto Aebersold Date: Thu, 21 Dec 2023 10:49:42 +0100 Subject: [PATCH] feat: show error message for invitation accept --- .../pages/learningMentor/InvitationAcceptPage.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/client/src/pages/learningMentor/InvitationAcceptPage.vue b/client/src/pages/learningMentor/InvitationAcceptPage.vue index 401bc50c..6e75e01d 100644 --- a/client/src/pages/learningMentor/InvitationAcceptPage.vue +++ b/client/src/pages/learningMentor/InvitationAcceptPage.vue @@ -7,7 +7,15 @@ const props = defineProps<{ invitationId: string; }>(); -const { data, error } = useCSRFFetch(`/api/mentor/${props.courseId}/invitations/accept`) +const { data, error } = useCSRFFetch( + `/api/mentor/${props.courseId}/invitations/accept`, + { + onFetchError(ctx) { + ctx.error = ctx.data; + return ctx; + }, + } +) .post({ invitation_id: props.invitationId, }) @@ -31,6 +39,9 @@ const { data, error } = useCSRFFetch(`/api/mentor/${props.courseId}/invitations/
help@vbv.ch
+
+ {{ $t("a.Fehlermeldung") }}: {{ error.message }} +