diff --git a/resources/js/views/dashboard/EventEdit.vue b/resources/js/views/dashboard/EventEdit.vue index 14b5ff5..c5f263a 100644 --- a/resources/js/views/dashboard/EventEdit.vue +++ b/resources/js/views/dashboard/EventEdit.vue @@ -31,24 +31,24 @@
@@ -96,7 +96,7 @@ - +
{ form.controls.price.value = data.event.price; form.controls.ages.value = data.event.ages; - attachments.value = (data.event.attachments || []).map( - function (attachment) { - return attachment.id.toString(); - }, - ); + attachments.value = data.event.attachments; } catch (err) { pageError.value = err.status; } finally { @@ -330,6 +326,7 @@ const handleSubmit = async () => { hero: form.controls.hero.value.id, price: form.controls.price.value, ages: form.controls.ages.value, + attachments: attachments.value.map((item) => item.id), }; let event_id = ""; @@ -355,13 +352,6 @@ const handleSubmit = async () => { } } - await api.put({ - url: `/events/${event_id}/attachments`, - body: { - attachments: attachments.value, - }, - }); - useToastStore().addToast({ title: route.params.id ? "Event Updated" : "Event Created", content: route.params.id