From b71e715cf5b453c42dca2b450764e14d2c5a78cb Mon Sep 17 00:00:00 2001 From: Alexis <35.alexis.pele@gmail.com> Date: Fri, 25 Apr 2025 21:06:19 +0200 Subject: [PATCH] Fixed call stack issue --- components/calendar/form/Update.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/calendar/form/Update.vue b/components/calendar/form/Update.vue index a4dbdc1..dd8f2c1 100644 --- a/components/calendar/form/Update.vue +++ b/components/calendar/form/Update.vue @@ -36,8 +36,10 @@ const isUpdatingCalendar = ref(false) async function handleSubmit() { isUpdatingCalendar.value = true + const fetchBody = { ...calendarSkeleton.value, worldId: props.world?.id } + const { error } = await tryCatch( - $fetch(`/api/calendars/${calendarSkeleton.value.id}`, { method: "PATCH", body: { ...calendarSkeleton.value, worldId: props.world?.id } }) + $fetch(`/api/calendars/${calendarSkeleton.value.id}`, { method: "PATCH", body: fetchBody }) ) if (error) {