diff --git a/src/pages/Worker/Card/WorkerCalendar.vue b/src/pages/Worker/Card/WorkerCalendar.vue index 6677cb351..2e525aa30 100644 --- a/src/pages/Worker/Card/WorkerCalendar.vue +++ b/src/pages/Worker/Card/WorkerCalendar.vue @@ -16,6 +16,7 @@ const stateStore = useStateStore(); const route = useRoute(); const { t } = useI18n(); const workerIsFreelance = ref(); +const WorkerFreelanceRef = ref(); const workerCalendarFilterRef = ref(null); const workerCalendarRef = ref(null); const absenceType = ref(null); @@ -34,12 +35,6 @@ const onFetchActiveContract = (data) => { hasWorkCenter.value = Boolean(data?.workCenterFk); }; -const isFreelance = async () => { - const { data } = await axios.get(`Workers/${route.params.id}`); - - workerIsFreelance.value = data.isFreelance; -}; - const addEvent = (day, newEvent, isFestive = false) => { const timestamp = new Date(day).getTime(); let event = eventsMap.value[timestamp]; @@ -136,7 +131,7 @@ const refreshData = () => { updateYearHolidays(); updateContractHolidays(); getAbsences(); - isFreelance(); + WorkerFreelanceRef.value.fetch(); }; const onDeletedEvent = (timestamp) => { @@ -172,6 +167,7 @@ watch([year, businessFk], () => refreshData());