From 9783be1ff00dd2709f9e3633956e85797be49616 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 18 Dec 2024 10:45:02 +0100 Subject: [PATCH] fix: fixed recipient param --- src/pages/Worker/Card/WorkerTimeControl.vue | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/pages/Worker/Card/WorkerTimeControl.vue b/src/pages/Worker/Card/WorkerTimeControl.vue index 491e5e180..96e7cd441 100644 --- a/src/pages/Worker/Card/WorkerTimeControl.vue +++ b/src/pages/Worker/Card/WorkerTimeControl.vue @@ -100,15 +100,23 @@ const formattedWeekTotalHours = computed(() => secondsToHoursMinutes(weekTotalHours.value) ); +// const onInputChange = async (date) => { +// if (!date) return; + +// const { timestamp, outside } = date.scope; +// const { year, month, day } = timestamp; +// const _date = new Date(year, month - 1, day); +// setDate(_date); + +// if (outside) getMailStates(_date); +// }; + const onInputChange = async (date) => { if (!date) return; - const { timestamp, outside } = date.scope; - const { year, month, day } = timestamp; + const { year, month, day } = date.scope.timestamp; const _date = new Date(year, month - 1, day); setDate(_date); - - if (outside) getMailStates(_date); }; const setDate = async (date) => { @@ -381,12 +389,13 @@ const isUnsatisfied = async (reason) => { const resendEmail = async () => { const params = { - recipient: worker.value?.user?.email, + recipient: worker.value[0]?.user?.emailUser?.email, week: selectedWeekNumber.value, year: selectedDate.value.getFullYear(), workerId: Number(route.params.id), state: 'SENDED', }; + console.log('params: ', params); await axios.post('WorkerTimeControls/weekly-hour-record-email', params); await getMailStates(selectedDate.value); notify(t('Email sended'), 'positive');