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;
|
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({
|
.post({
|
||||||
invitation_id: props.invitationId,
|
invitation_id: props.invitationId,
|
||||||
})
|
})
|
||||||
|
|
@ -31,6 +39,9 @@ const { data, error } = useCSRFFetch(`/api/mentor/${props.courseId}/invitations/
|
||||||
<div>
|
<div>
|
||||||
<a class="underline" href="mailto:help@vbv.ch">help@vbv.ch</a>
|
<a class="underline" href="mailto:help@vbv.ch">help@vbv.ch</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="error.message" class="my-4">
|
||||||
|
{{ $t("a.Fehlermeldung") }}: {{ error.message }}
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<i18next
|
<i18next
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue