From 4fecee5963e8c67cb2d2b5e3b4dbdf36faf0b968 Mon Sep 17 00:00:00 2001 From: SamuelQuetin Date: Mon, 30 Sep 2024 14:28:06 +0200 Subject: [PATCH] FIX ajout du throw error en cas d'erreur venant du back --- src/components/MenuDownloadFile.vue | 7 +++++++ src/views/Exemplarisation/ExempTable.vue | 6 +++++- src/views/Modification/ModifTable.vue | 5 ++++- src/views/Recouvrement/RecouvTable.vue | 6 +++++- src/views/Suppression/SuppTable.vue | 5 ++++- 5 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/components/MenuDownloadFile.vue b/src/components/MenuDownloadFile.vue index 3c85167..84194cb 100644 --- a/src/components/MenuDownloadFile.vue +++ b/src/components/MenuDownloadFile.vue @@ -81,6 +81,7 @@ const props = defineProps({ type: Object } }) +const emits = defineEmits(['onError']); const etatsDemande = ref([]); @@ -105,6 +106,9 @@ onMounted(() => { .then(response => { etatsDemande.value = response.data; }) + .catch( err => { + emits('onError', err); + }) }) function downloadFile(filePrefix, extension) { @@ -118,5 +122,8 @@ function downloadFile(filePrefix, extension) { link.click(); link.remove(); }) + .catch( err => { + emits('onError', err); + }) } diff --git a/src/views/Exemplarisation/ExempTable.vue b/src/views/Exemplarisation/ExempTable.vue index 3151d7a..85ccb04 100644 --- a/src/views/Exemplarisation/ExempTable.vue +++ b/src/views/Exemplarisation/ExempTable.vue @@ -109,7 +109,7 @@ - + @@ -356,6 +356,10 @@ function saveComment(){ filterItems(); }) } + +function throwError(error) { + emit('backendError',error); +}