fix(pay-periods): specify that is_approved can be null in controller, to not confuse false with null
This commit is contained in:
parent
da74a93fa0
commit
7eb1471edb
|
|
@ -52,7 +52,7 @@ export class PayPeriodsController {
|
||||||
): Promise<Result<{ shifts: number, expenses: number }, string>> {
|
): Promise<Result<{ shifts: number, expenses: number }, string>> {
|
||||||
if (!email) return {success: false, error: 'EMAIL_REQUIRED'};
|
if (!email) return {success: false, error: 'EMAIL_REQUIRED'};
|
||||||
if (!timesheet_ids || timesheet_ids.length < 1) return {success: false, error: 'TIMESHEET_ID_REQUIRED'};
|
if (!timesheet_ids || timesheet_ids.length < 1) return {success: false, error: 'TIMESHEET_ID_REQUIRED'};
|
||||||
if (!is_approved) return {success: false, error: 'APPROVAL_STATUS_REQUIRED'}
|
if (is_approved === null) return {success: false, error: 'APPROVAL_STATUS_REQUIRED'}
|
||||||
return this.commandService.bulkApproveEmployee(email, timesheet_ids, is_approved);
|
return this.commandService.bulkApproveEmployee(email, timesheet_ids, is_approved);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user