Bug fix
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
William Buezas 2024-05-15 10:27:45 -03:00
parent cd8095d3b8
commit f3a5ebbcec
2 changed files with 8 additions and 7 deletions

View File

@ -1,5 +1,5 @@
<script setup>
import { computed, onMounted, ref, watch } from 'vue';
import { computed, onMounted, ref, watch, onUnmounted } from 'vue';
import { useI18n } from 'vue-i18n';
import ZoneDeliveryPanel from './ZoneDeliveryPanel.vue';
@ -23,9 +23,10 @@ const days = ref({});
const exclusions = ref({});
const geoExclusions = ref({});
const events = ref([]);
const { store } = useArrayData('ZoneDeliveryDays', {
const arrayData = useArrayData('ZoneDeliveryDays', {
url: 'Zones/getEvents',
});
const { store } = arrayData;
const refreshEvents = () => {
days.value = {};
@ -174,6 +175,8 @@ onMounted(async () => {
date.value = initialDate;
weekdayStore.initStore();
});
onUnmounted(() => arrayData.destroy());
</script>
<template>

View File

@ -87,11 +87,9 @@ const onSubmit = async () => {
onMounted(async () => {
deliveryMethodFk.value = 'delivery';
await fetchData();
if (arrayData?.store?.userParams && arrayData?.store?.userParams) {
formData.geoFk = arrayData.store?.userParams?.geoFk;
formData.agencyModeFk = arrayData.store?.userParams?.agencyModeFk;
}
if (formData.geoFk || formData.agencyModeFk) await fetchData();
});
</script>