From 52b9121e70bcc0dcb3739ce4ed2b5fa73f927b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benoi=CC=82t=20Burgener?= Date: Mon, 1 Apr 2024 19:26:24 +0200 Subject: [PATCH] Fix recipes image upload --- packages/frontend/src/components/forms/ImageUploader.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/components/forms/ImageUploader.vue b/packages/frontend/src/components/forms/ImageUploader.vue index 6b24581..1b16377 100644 --- a/packages/frontend/src/components/forms/ImageUploader.vue +++ b/packages/frontend/src/components/forms/ImageUploader.vue @@ -93,8 +93,13 @@ function handleImageChange(e: Event) { const file = (e.target as HTMLInputElement)?.files?.[0]; if (file) { - upload(file).then((response) => { - emit('update:model-value', response); + upload(file).then(({ id, filename_download, storage }) => { + // Take only required values as relations causes issues saving the recipe + emit('update:model-value', { + id, + filename_download, + storage, + }); }); } }