From df8af541c1d7c3de6c47a1ce253dfda528a112a7 Mon Sep 17 00:00:00 2001 From: Alexis <35.alexis.pele@gmail.com> Date: Thu, 19 Dec 2024 16:28:38 +0100 Subject: [PATCH] Added updated toast --- components/calendar/form/UpdateEvent.vue | 6 ++++++ i18n.config.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/components/calendar/form/UpdateEvent.vue b/components/calendar/form/UpdateEvent.vue index b0a019c..4ade519 100644 --- a/components/calendar/form/UpdateEvent.vue +++ b/components/calendar/form/UpdateEvent.vue @@ -26,6 +26,12 @@ async function handleAction() { await updateEventFromSkeleton() emit("event-updated") + + toast({ + title: t("entity.calendar.event.updatedToast.title", { event: eventSkeleton.value.title }), + variant: "success", + duration: 3000 + }) } catch (err) { // eslint-disable-next-line @typescript-eslint/no-explicit-any const apiError = (err as any).data as APIError diff --git a/i18n.config.ts b/i18n.config.ts index 9fda9f1..48dbc11 100644 --- a/i18n.config.ts +++ b/i18n.config.ts @@ -149,6 +149,9 @@ export default defineI18nConfig(() => ({ title: "Edit event", subtitle: "Update event data", }, + updatedToast: { + title: "Event \"{event}\" has been successfuly updated.", + }, editErrors: { toastTitle: "Event wasn't updated.", title_too_big: "Title should be less than 120 characters long.", @@ -372,6 +375,9 @@ export default defineI18nConfig(() => ({ title: "Modifier l'évènement", subtitle: "Mettre à jour les données de l'évènement", }, + updatedToast: { + title: "L'évènement \"{event}\" a été modifié avec succès.", + }, editErrors: { toastTitle: "L'évènement n'a pas été modifié", title_too_big: "Le titre doit être inférieur à 120 caractères.",