fix(preset): fix issue where notification of creation was being sent for weekly preset application
This commit is contained in:
parent
652bc1cba1
commit
83f5da2e4a
|
|
@ -56,12 +56,12 @@ export class SchedulePresetsController {
|
||||||
return await this.applyService.applyPresetToTimesheet(email, timesheet_id);
|
return await this.applyService.applyPresetToTimesheet(email, timesheet_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post('apply-preset/:employeeEmail')
|
@Post('apply-preset/:email')
|
||||||
@ModuleAccessAllowed(ModulesEnum.timesheets_approval)
|
@ModuleAccessAllowed(ModulesEnum.timesheets_approval)
|
||||||
async applyPresetToTimesheetFromApproval(
|
async applyPresetToTimesheetFromApproval(
|
||||||
@Access('email') email: string,
|
@Access('email') email: string,
|
||||||
@Body('timesheet_id') timesheet_id: number,
|
@Body('timesheet_id') timesheet_id: number,
|
||||||
@Param('employeeEmail') employee_email: string,
|
@Param('email') employee_email: string,
|
||||||
) {
|
) {
|
||||||
return await this.applyService.applyPresetToTimesheet(email, timesheet_id, employee_email);
|
return await this.applyService.applyPresetToTimesheet(email, timesheet_id, employee_email);
|
||||||
}
|
}
|
||||||
|
|
@ -77,14 +77,14 @@ export class SchedulePresetsController {
|
||||||
return await this.applyService.applyPresetToDay(email, timesheet_id, week_day_index, date);
|
return await this.applyService.applyPresetToDay(email, timesheet_id, week_day_index, date);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post('apply-day-preset/:employeeEmail')
|
@Post('apply-day-preset/:email')
|
||||||
@ModuleAccessAllowed(ModulesEnum.timesheets_approval)
|
@ModuleAccessAllowed(ModulesEnum.timesheets_approval)
|
||||||
async applyPresetToDayFromApproval(
|
async applyPresetToDayFromApproval(
|
||||||
@Access('email') email: string,
|
@Access('email') email: string,
|
||||||
@Body('timesheet_id') timesheet_id: number,
|
@Body('timesheet_id') timesheet_id: number,
|
||||||
@Body('week_day_index') week_day_index: number,
|
@Body('week_day_index') week_day_index: number,
|
||||||
@Body('date') date: string,
|
@Body('date') date: string,
|
||||||
@Param('employeeEmail') employee_email: string,
|
@Param('email') employee_email: string,
|
||||||
) {
|
) {
|
||||||
return await this.applyService.applyPresetToDay(email, timesheet_id, week_day_index, date, employee_email);
|
return await this.applyService.applyPresetToDay(email, timesheet_id, week_day_index, date, employee_email);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ export class SchedulePresetsApplyService {
|
||||||
created_shifts.push(shift.data);
|
created_shifts.push(shift.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await this.shiftService.createOneOrManyShifts(user_email, created_shifts);
|
const response = await this.shiftService.createOneOrManyShifts(user_email, created_shifts, false);
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
// notify timesheet-approval observers of changes
|
// notify timesheet-approval observers of changes
|
||||||
if (!employee_email) {
|
if (!employee_email) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user