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) {