From 6263481a3e1e87b41f3db7ecd336dff34461abde Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 28 Nov 2024 13:42:22 +0100 Subject: [PATCH] refactor: exclusionCreate function and translations --- src/pages/Supplier/SupplierList.vue | 5 ++--- src/pages/Zone/Card/ZoneEventExclusionForm.vue | 12 ++++++------ src/pages/Zone/locale/en.yml | 2 ++ src/pages/Zone/locale/es.yml | 2 ++ 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/pages/Supplier/SupplierList.vue b/src/pages/Supplier/SupplierList.vue index 69f826201..a54012b34 100644 --- a/src/pages/Supplier/SupplierList.vue +++ b/src/pages/Supplier/SupplierList.vue @@ -124,8 +124,7 @@ const columns = computed(() => [ -en: - Search suppliers: Search suppliers -es: + es: Search suppliers: Buscar proveedores + Create Supplier: Crear proveedor diff --git a/src/pages/Zone/Card/ZoneEventExclusionForm.vue b/src/pages/Zone/Card/ZoneEventExclusionForm.vue index 62cf7cf8d..0882036c1 100644 --- a/src/pages/Zone/Card/ZoneEventExclusionForm.vue +++ b/src/pages/Zone/Card/ZoneEventExclusionForm.vue @@ -67,12 +67,12 @@ const exclusionGeoCreate = async () => { }; const exclusionCreate = async () => { - if (isNew.value || props.event?.type) - await axios.post(`Zones/${route.params.id}/exclusions`, [{ dated: dated }]); - else - await axios.put(`Zones/${route.params.id}/exclusions/${props.event?.id}`, { - dated: dated, - }); + const url = `Zones/${route.params.id}/exclusions`; + const body = { + dated, + }; + if (isNew.value || props.event?.type) await axios.post(`${url}`, [body]); + else await axios.put(`${url}/${props.event?.id}`, body); await refetchEvents(); }; diff --git a/src/pages/Zone/locale/en.yml b/src/pages/Zone/locale/en.yml index a9cd700df..ba4982311 100644 --- a/src/pages/Zone/locale/en.yml +++ b/src/pages/Zone/locale/en.yml @@ -61,6 +61,8 @@ eventsPanel: events: Events everyday: Everyday delete: Delete + deleteTitle: This item will be deleted + deleteSubtitle: Are you sure you want to continue? eventsExclusionForm: addExclusion: Add exclusion editExclusion: Edit exclusion diff --git a/src/pages/Zone/locale/es.yml b/src/pages/Zone/locale/es.yml index c4820a6c0..d0bab83f4 100644 --- a/src/pages/Zone/locale/es.yml +++ b/src/pages/Zone/locale/es.yml @@ -61,6 +61,8 @@ eventsPanel: events: Eventos everyday: Todos los días delete: Eliminar + deleteTitle: Eliminar evento + deleteSubtitle: ¿Seguro que quieres eliminar este evento? eventsExclusionForm: addExclusion: Añadir exclusión editExclusion: Editar exclusión