Skip to content

Commit

Permalink
Merge pull request #131 from abes-esr/ITEM-247-Mettre-en-place-la-ges…
Browse files Browse the repository at this point in the history
…tion-du-cas-ou-le-serveur-ne-répond-pas-pour-télécharger-des-fichiers

FIX ajout du throw error en cas d'erreur venant du back
  • Loading branch information
EryneKL authored Sep 30, 2024
2 parents ceaf006 + 4fecee5 commit 675d057
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
7 changes: 7 additions & 0 deletions src/components/MenuDownloadFile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ const props = defineProps({
type: Object
}
})
const emits = defineEmits(['onError']);
const etatsDemande = ref([]);
Expand All @@ -105,6 +106,9 @@ onMounted(() => {
.then(response => {
etatsDemande.value = response.data;
})
.catch( err => {
emits('onError', err);
})
})
function downloadFile(filePrefix, extension) {
Expand All @@ -118,5 +122,8 @@ function downloadFile(filePrefix, extension) {
link.click();
link.remove();
})
.catch( err => {
emits('onError', err);
})
}
</script>
6 changes: 5 additions & 1 deletion src/views/Exemplarisation/ExempTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
</td>
<td class="text-center">
<!-- Colonne Téléchargement -->
<menu-download-file :demande="item"></menu-download-file>
<menu-download-file :demande="item" @on-error="throwError"></menu-download-file>
</td>
<td class="text-center">
<!-- Colonne Action -->
Expand Down Expand Up @@ -356,6 +356,10 @@ function saveComment(){
filterItems();
})
}
function throwError(error) {
emit('backendError',error);
}
</script>

<style scoped>
Expand Down
5 changes: 4 additions & 1 deletion src/views/Modification/ModifTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
</v-progress-linear>
</td>
<td class="text-center">
<menu-download-file :demande="item"></menu-download-file>
<menu-download-file :demande="item" @on-error="throwError"></menu-download-file>
</td>
<td class="text-center">
<!-- Colonne Action -->
Expand Down Expand Up @@ -376,6 +376,9 @@ function saveComment() {
});
}
function throwError(error) {
emit('backendError',error);
}
</script>

<style scoped>
Expand Down
6 changes: 5 additions & 1 deletion src/views/Recouvrement/RecouvTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
</v-progress-linear>
</td>
<td class="text-center">
<menu-download-file :demande="item"></menu-download-file>
<menu-download-file :demande="item" @on-error="throwError"></menu-download-file>
</td>
<td class="text-center">
<!-- Colonne Action -->
Expand Down Expand Up @@ -340,6 +340,10 @@ function saveComment(){
filterItems();
})
}
function throwError(error) {
emit('backendError',error);
}
</script>

<style scoped>
Expand Down
5 changes: 4 additions & 1 deletion src/views/Suppression/SuppTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
</v-progress-linear>
</td>
<td class="text-center">
<menu-download-file :demande="item"></menu-download-file>
<menu-download-file :demande="item" @on-error="throwError"></menu-download-file>
</td>
<td class="text-center">
<!-- Colonne Action -->
Expand Down Expand Up @@ -351,6 +351,9 @@ function saveComment() {
});
}
function throwError(error) {
emit('backendError',error);
}
</script>

<style scoped>
Expand Down

0 comments on commit 675d057

Please sign in to comment.