fix(presets): small fix to schedule preset apply service
This commit is contained in:
parent
c427cc7718
commit
1f27baf100
|
|
@ -70,7 +70,7 @@ export class SchedulePresetsApplyService {
|
|||
const created_shifts: ShiftDto[] = [];
|
||||
|
||||
for (const preset_shift of default_preset_shifts) {
|
||||
const date = dated_map.find(date => date.getUTCDay() === WEEKDAY_MAP[preset_shift.week_day])
|
||||
const date = dated_map.find(date => date.getUTCDay() === WEEKDAY_MAP.findIndex(weekday => weekday === preset_shift.week_day))
|
||||
if (!date) return { success: false, error: 'INVALID_PRESET_DATE' };
|
||||
|
||||
const shift = await this.createShiftFromPreset(preset_shift, date, timesheet.id)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user