From 710b45f43ab0ecf3a90142708f060bfe3151f782 Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 3 May 2024 14:49:50 +0200 Subject: [PATCH 1/3] refs #6842 isFreelance --- src/pages/Worker/Card/WorkerCalendar.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/pages/Worker/Card/WorkerCalendar.vue b/src/pages/Worker/Card/WorkerCalendar.vue index 288e78dcf..c0a70571e 100644 --- a/src/pages/Worker/Card/WorkerCalendar.vue +++ b/src/pages/Worker/Card/WorkerCalendar.vue @@ -13,7 +13,7 @@ import axios from 'axios'; const stateStore = useStateStore(); const route = useRoute(); const { t } = useI18n(); - +const workerIsFreelance = ref(); const workerCalendarFilterRef = ref(null); const workerCalendarRef = ref(null); const absenceType = ref(null); @@ -32,6 +32,12 @@ 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]; @@ -128,6 +134,7 @@ const refreshData = () => { updateYearHolidays(); updateContractHolidays(); getAbsences(); + isFreelance(); }; const onDeletedEvent = (timestamp) => { @@ -151,6 +158,11 @@ watch([year, businessFk], () => refreshData()); @on-fetch="(data) => (isSubordinate = data)" auto-load /> +