From dde3f8504aab7d53a3ede47aea612ebbf5af3b91 Mon Sep 17 00:00:00 2001
From: Alexis <35.alexis.pele@gmail.com>
Date: Thu, 19 Dec 2024 16:16:45 +0100
Subject: [PATCH] Fixed updating modal not closing as well
---
components/calendar/dialog/UpdateEvent.vue | 10 +++-------
components/calendar/form/UpdateEvent.vue | 4 ++++
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/components/calendar/dialog/UpdateEvent.vue b/components/calendar/dialog/UpdateEvent.vue
index 46003e6..279613f 100644
--- a/components/calendar/dialog/UpdateEvent.vue
+++ b/components/calendar/dialog/UpdateEvent.vue
@@ -1,8 +1,6 @@
@@ -43,7 +39,7 @@ function handleClosing(e: Event) {
-
+
diff --git a/components/calendar/form/UpdateEvent.vue b/components/calendar/form/UpdateEvent.vue
index 716cf4c..b0a019c 100644
--- a/components/calendar/form/UpdateEvent.vue
+++ b/components/calendar/form/UpdateEvent.vue
@@ -3,6 +3,8 @@ import { PhAlarm, PhCircleNotch, PhEye, PhEyeClosed, PhMapPinArea, PhPencilSimpl
import { useToast } from "~/components/ui/toast";
import type { APIError } from "~/models/Errors";
+const emit = defineEmits(["event-updated"])
+
const { resetSkeleton, updateEventFromSkeleton, cancelLatestRequest } = useCalendar()
const { eventSkeleton, lastActiveEvent } = storeToRefs(useCalendar())
@@ -22,6 +24,8 @@ async function handleAction() {
try {
await updateEventFromSkeleton()
+
+ emit("event-updated")
} catch (err) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const apiError = (err as any).data as APIError