0
0
Fork 0

refactor: exclusionCreate function and translations

This commit is contained in:
Jon Elias 2024-11-28 13:42:22 +01:00
parent 61d0d71538
commit 6263481a3e
4 changed files with 12 additions and 9 deletions

View File

@ -124,8 +124,7 @@ const columns = computed(() => [
</template>
<i18n>
en:
Search suppliers: Search suppliers
es:
Search suppliers: Buscar proveedores
Create Supplier: Crear proveedor
</i18n>

View File

@ -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();
};

View File

@ -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

View File

@ -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