fix: remove ctx
gitea/salix/pipeline/pr-master There was a failure building this commit Details

This commit is contained in:
Carlos Satorres 2024-12-02 10:47:44 +01:00
parent 4e6b83809b
commit fb40e25c7c
1 changed files with 2 additions and 2 deletions

View File

@ -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`);