fix: remove ctx
gitea/salix/pipeline/pr-master There was a failure building this commit
Details
gitea/salix/pipeline/pr-master There was a failure building this commit
Details
This commit is contained in:
parent
4e6b83809b
commit
fb40e25c7c
|
@ -54,11 +54,11 @@ module.exports = Self => {
|
|||
try {
|
||||
const isSubordinate = await models.Worker.isSubordinate(ctx, id, myOptions);
|
||||
const isTeamBoss = await models.ACL.checkAccessAcl(ctx, 'Worker', 'isTeamBoss', 'WRITE');
|
||||
const canCreateAbsenceInPast = await models.ACL.checkAccessAcl(ctx, 'Worker', 'canCreateAbsenceInPast', 'WRITE');
|
||||
|
||||
if (!isSubordinate || (isSubordinate && userId == id && !isTeamBoss))
|
||||
throw new UserError(`You don't have enough privileges`);
|
||||
|
||||
const canCreateAbsenceInPast = await models.ACL.checkAccessAcl(ctx, 'Worker', 'canCreateAbsenceInPast', 'WRITE');
|
||||
const labour = await models.WorkerLabour.findById(args.businessFk, {
|
||||
include: {relation: 'department'}
|
||||
}, myOptions);
|
||||
|
@ -114,7 +114,7 @@ module.exports = Self => {
|
|||
if ((holiday && isFestive) && (workCenter.workcenterFk === holiday.workCenterFk))
|
||||
throw new UserError(`Cannot add holidays on this day`);
|
||||
|
||||
const newDate = new Date(ctx.args.dated).getTime();
|
||||
const newDate = new Date(args.dated).getTime();
|
||||
const nowDate = now.getTime();
|
||||
if ((nowDate > newDate) && !canCreateAbsenceInPast)
|
||||
throw new UserError(`Holidays to past days not available`);
|
||||
|
|
Loading…
Reference in New Issue