chore: simplify
This commit is contained in:
parent
9403588d7b
commit
eaa62909ff
|
@ -62,9 +62,8 @@ module.exports = Self => {
|
||||||
await models.ACL.checkAccessAcl(ctx, 'Worker', 'canCreateAbsenceInPast', 'WRITE');
|
await models.ACL.checkAccessAcl(ctx, 'Worker', 'canCreateAbsenceInPast', 'WRITE');
|
||||||
const now = Date.vnNew();
|
const now = Date.vnNew();
|
||||||
const newDate = new Date(args.dated).getTime();
|
const newDate = new Date(args.dated).getTime();
|
||||||
const nowDate = now.getTime();
|
|
||||||
|
|
||||||
if ((nowDate > newDate) && !canCreateAbsenceInPast)
|
if ((now.getTime() > newDate) && !canCreateAbsenceInPast)
|
||||||
throw new UserError(`Holidays to past days not available`);
|
throw new UserError(`Holidays to past days not available`);
|
||||||
|
|
||||||
const labour = await models.WorkerLabour.findById(args.businessFk,
|
const labour = await models.WorkerLabour.findById(args.businessFk,
|
||||||
|
|
Loading…
Reference in New Issue