From 68260c1383472f9a76901de87691a5cc64c11118 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Thu, 1 Feb 2024 11:35:14 -0300 Subject: [PATCH] force item descriptor image upload --- src/components/EditPictureForm.vue | 7 ++++--- src/pages/Item/Card/ItemDescriptor.vue | 16 ++++++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/components/EditPictureForm.vue b/src/components/EditPictureForm.vue index d47d60fee..44d44587f 100644 --- a/src/components/EditPictureForm.vue +++ b/src/components/EditPictureForm.vue @@ -12,7 +12,7 @@ import 'croppie/croppie.css'; import useNotify from 'src/composables/useNotify.js'; import axios from 'axios'; -const emit = defineEmits(['closeForm']); +const emit = defineEmits(['closeForm', 'onPhotoUploaded']); const props = defineProps({ id: { @@ -175,8 +175,6 @@ const onUploadAccept = () => { .then(() => makeRequest()); } catch (err) { console.error('Error uploading image'); - } finally { - emit('closeForm'); } }; @@ -194,6 +192,9 @@ const makeRequest = async () => { }, }); + emit('closeForm'); + emit('onPhotoUploaded'); + notify(t('globals.dataSaved'), 'positive'); }; diff --git a/src/pages/Item/Card/ItemDescriptor.vue b/src/pages/Item/Card/ItemDescriptor.vue index 41398bd28..e1cbfb638 100644 --- a/src/pages/Item/Card/ItemDescriptor.vue +++ b/src/pages/Item/Card/ItemDescriptor.vue @@ -1,5 +1,5 @@