fix(timesheet): fix issue where daily presets were not applying correctly

This commit is contained in:
Nic D 2026-03-23 15:33:17 -04:00
parent 985b8a7564
commit 25cd208bfd
3 changed files with 3 additions and 2 deletions

View File

@ -79,6 +79,7 @@
}
const onClickApplyDailyPreset = async () => {
console.log(timesheetId, weekDayIndex, day.value.date, employeeEmail);
await timesheetApi.applyPreset(timesheetId, weekDayIndex, day.value.date, employeeEmail);
}

View File

@ -103,7 +103,7 @@
>
<ShiftListDay
v-model="row[dayIndex]!.day"
:week-day-index="dayIndex"
:week-day-index="rowIndex"
:timesheet-id="day.timesheetId"
:timesheet-approved="day.isTimesheetApproved"
/>

View File

@ -178,7 +178,7 @@ export const useTimesheetStore = defineStore('timesheet', () => {
try {
let response;
if (week_day_index && date)
if (week_day_index !== undefined && date !== undefined)
response = await timesheetService.applyPresetToDay(timesheet_id, week_day_index, date, employeeEmail);
else
response = await timesheetService.applyPresetToWeek(timesheet_id, employeeEmail);