refs #6842 pr changes
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Carlos Satorres 2024-05-07 10:20:26 +02:00
parent 743faef956
commit ac0993aa11
1 changed files with 3 additions and 7 deletions

View File

@ -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());
<FetchData
:url="`Workers/${route.params.id}`"
@on-fetch="(data) => (workerIsFreelance = data.isFreelance)"
ref="WorkerFreelanceRef"
auto-load
/>
<template v-if="stateStore.isHeaderMounted()">