From 737d12a1eafff8c418657488a4430bd818bb68b1 Mon Sep 17 00:00:00 2001 From: Alejandro MG Date: Mon, 16 Dec 2024 12:02:03 +0100 Subject: [PATCH] Ensures the image format is supported for declaration assignments --- frontend/src/views/ProducerFormPage/AttachmentTab.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/ProducerFormPage/AttachmentTab.vue b/frontend/src/views/ProducerFormPage/AttachmentTab.vue index 70f6a8757..2f6db5ae0 100644 --- a/frontend/src/views/ProducerFormPage/AttachmentTab.vue +++ b/frontend/src/views/ProducerFormPage/AttachmentTab.vue @@ -20,7 +20,7 @@ { window.alert(`Le fichier ${files[i].name} dépasse la taille limite de 2 Mo`) continue } + const formatIsValid = acceptedTypes.indexOf(files[i].type) > -1 + if (!formatIsValid) { + window.alert( + `Le format du fichier ${files[i].name} n'est pas supporté. Merci de joindre un fichier en JPG, GIF, PNG ou PDF.` + ) + continue + } const base64 = await toBase64(files[i]) container.push({ ...{