Merge pull request 'hotfix-workerCalendar' (!1527) from hotfix-workerCalendar into master
gitea/salix-front/pipeline/head This commit looks good Details
gitea/salix-front/pipeline/pr-test This commit looks good Details

Reviewed-on: #1527
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
Carlos Satorres 2025-03-03 07:27:09 +00:00
commit 86454b60e9
1 changed files with 3 additions and 3 deletions

View File

@ -79,7 +79,7 @@ const editEvent = async (event) => {
};
const { data } = await axios.patch(
`Workers/${route.params.id}/updateAbsence`,
params
params,
);
if (data) emit('refresh');
@ -108,14 +108,14 @@ const handleDateSelected = (date) => {
if (!event) createEvent(_date);
};
const handleEventSelected = (event, { year, month, day }) => {
const handleEventSelected = async (event, { year, month, day }) => {
if (!props.absenceType) {
notify(t('Choose an absence type from the right menu'), 'warning');
return;
}
const date = new Date(year, month - 1, day);
if (!event?.absenceId) createEvent(date);
if (!event?.absenceId) await createEvent(date);
else if (event.type == props.absenceType.code) deleteEvent(event, date);
else editEvent(event);
};