0
0
Fork 0

fix: #6842 Not update calendar correctly

This commit is contained in:
Javier Segarra 2024-05-03 15:05:37 +02:00
parent 710b45f43a
commit 743faef956
2 changed files with 12 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { ref, watch } from 'vue'; import { nextTick, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
@ -10,6 +10,8 @@ import WorkerCalendarItem from 'pages/Worker/Card/WorkerCalendarItem.vue';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import axios from 'axios'; import axios from 'axios';
import { useRouter } from 'vue-router';
const router = useRouter();
const stateStore = useStateStore(); const stateStore = useStateStore();
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
@ -143,12 +145,21 @@ const onDeletedEvent = (timestamp) => {
if (festiveEventsMap.value[timestamp]) if (festiveEventsMap.value[timestamp])
eventsMap.value[timestamp] = festiveEventsMap.value[timestamp]; eventsMap.value[timestamp] = festiveEventsMap.value[timestamp];
}; };
const activeContractRef = ref(null);
watch(
() => router.currentRoute.value.params.id,
async () => {
await nextTick();
await activeContractRef.value.fetch();
}
);
watch([year, businessFk], () => refreshData()); watch([year, businessFk], () => refreshData());
</script> </script>
<template> <template>
<FetchData <FetchData
ref="activeContractRef"
:url="`Workers/${route.params.id}/activeContract`" :url="`Workers/${route.params.id}/activeContract`"
@on-fetch="onFetchActiveContract" @on-fetch="onFetchActiveContract"
auto-load auto-load

View File

@ -36,7 +36,6 @@ const filter = computed(() => {
}); });
const sip = ref(null); const sip = ref(null);
watch( watch(
() => [worker.value?.sip?.extension, state.get('extension')], () => [worker.value?.sip?.extension, state.get('extension')],
([newWorkerSip, newStateExtension], [oldWorkerSip, oldStateExtension]) => { ([newWorkerSip, newStateExtension], [oldWorkerSip, oldStateExtension]) => {