fix: fixed recipient param

This commit is contained in:
Jon Elias 2024-12-18 10:45:02 +01:00
parent 8502e13bdb
commit 9783be1ff0
1 changed files with 14 additions and 5 deletions

View File

@ -100,15 +100,23 @@ const formattedWeekTotalHours = computed(() =>
secondsToHoursMinutes(weekTotalHours.value) 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) => { const onInputChange = async (date) => {
if (!date) return; if (!date) return;
const { timestamp, outside } = date.scope; const { year, month, day } = date.scope.timestamp;
const { year, month, day } = timestamp;
const _date = new Date(year, month - 1, day); const _date = new Date(year, month - 1, day);
setDate(_date); setDate(_date);
if (outside) getMailStates(_date);
}; };
const setDate = async (date) => { const setDate = async (date) => {
@ -381,12 +389,13 @@ const isUnsatisfied = async (reason) => {
const resendEmail = async () => { const resendEmail = async () => {
const params = { const params = {
recipient: worker.value?.user?.email, recipient: worker.value[0]?.user?.emailUser?.email,
week: selectedWeekNumber.value, week: selectedWeekNumber.value,
year: selectedDate.value.getFullYear(), year: selectedDate.value.getFullYear(),
workerId: Number(route.params.id), workerId: Number(route.params.id),
state: 'SENDED', state: 'SENDED',
}; };
console.log('params: ', params);
await axios.post('WorkerTimeControls/weekly-hour-record-email', params); await axios.post('WorkerTimeControls/weekly-hour-record-email', params);
await getMailStates(selectedDate.value); await getMailStates(selectedDate.value);
notify(t('Email sended'), 'positive'); notify(t('Email sended'), 'positive');