Merge branch 'master' into hotfix_negative_available

This commit is contained in:
Javier Segarra 2025-04-15 12:23:31 +02:00
commit 31acc3d0a1
3 changed files with 18 additions and 5 deletions

View File

@ -232,7 +232,7 @@ fr:
pt: Portugais pt: Portugais
pt: pt:
Send SMS: Enviar SMS Send SMS: Enviar SMS
CustomerDefaultLanguage: Este cliente utiliza o <strong>{locale}</strong> como seu idioma padrão CustomerDefaultLanguage: Este cliente utiliza o {locale} como seu idioma padrão
Language: Linguagem Language: Linguagem
Phone: Móvel Phone: Móvel
Subject: Assunto Subject: Assunto

View File

@ -101,7 +101,7 @@ const onNextStep = async () => {
t('basicData.negativesConfirmMessage'), t('basicData.negativesConfirmMessage'),
submitWithNegatives, submitWithNegatives,
); );
else submit(); else await submit();
} }
}; };
</script> </script>

View File

@ -130,8 +130,21 @@ const onSubmit = async () => {
const deleteEvent = async () => { const deleteEvent = async () => {
if (!props.event) return; if (!props.event) return;
const exclusionId = props.event?.zoneExclusionFk || props.event?.id; if (!props.event.created) {
await axios.delete(`Zones/${route.params.id}/exclusions/${exclusionId}`); const filter = {
where: {
dated: dated.value,
},
};
const params = { filter: JSON.stringify(filter) };
const { data: res } = await axios.get(`Zones/${route.params.id}/exclusions`, {
params,
});
if (res) await axios.delete(`Zones/${route.params.id}/exclusions/${res[0].id}`);
} else {
const exclusionId = props.event?.zoneExclusionFk || props.event?.id;
await axios.delete(`Zones/${route.params.id}/exclusions/${exclusionId}`);
}
await refetchEvents(); await refetchEvents();
}; };
@ -143,7 +156,7 @@ const refetchEvents = async () => {
}; };
onMounted(() => { onMounted(() => {
if (props.event) { if (props.event && props.event.dated) {
dated.value = props.event?.dated; dated.value = props.event?.dated;
excludeType.value = excludeType.value =
props.eventType === 'geoExclusion' ? 'specificLocations' : 'all'; props.eventType === 'geoExclusion' ? 'specificLocations' : 'all';