feat: show error message for invitation accept
This commit is contained in:
parent
04b944711e
commit
b0849addfd
|
|
@ -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/
|
|||
<div>
|
||||
<a class="underline" href="mailto:help@vbv.ch">help@vbv.ch</a>
|
||||
</div>
|
||||
<div v-if="error.message" class="my-4">
|
||||
{{ $t("a.Fehlermeldung") }}: {{ error.message }}
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<i18next
|
||||
|
|
|
|||
Loading…
Reference in New Issue