#6924 Notify absences only to department boss #3175

Merged
jon merged 12 commits from 6924-NotifyOnlyToBoss into dev 2024-11-21 07:06:28 +00:00
1 changed files with 1 additions and 3 deletions
Showing only changes of commit 7be1bc385f - Show all commits

View File

@ -58,9 +58,7 @@ module.exports = Self => {
if (!isSubordinate || (isSubordinate && userId == id && !isTeamBoss)) if (!isSubordinate || (isSubordinate && userId == id && !isTeamBoss))
throw new UserError(`You don't have enough privileges`); throw new UserError(`You don't have enough privileges`);
const labour = await models.WorkerLabour.findById(args.businessFk, { const labour = await models.WorkerLabour.findById(args.businessFk, myOptions);
Outdated
Review

findById espera 3 parametres (o 2 si no vols gastar options)
En este cas seria:
const labour = await models.WorkerLabour.findById(args.businessFk, null, myOptions);

Pero hi ha que especificar sempre els fields, entonces seria (per el que he vist, revisau per si acas)
const labour = await models.WorkerLabour.findById(args.businessFk, {fields: ['started', 'ended', 'businessFk']}, myOptions);

findById espera 3 parametres (o 2 si no vols gastar options) En este cas seria: `const labour = await models.WorkerLabour.findById(args.businessFk, null, myOptions);` Pero hi ha que especificar sempre els fields, entonces seria (per el que he vist, revisau per si acas) `const labour = await models.WorkerLabour.findById(args.businessFk, {fields: ['started', 'ended', 'businessFk']}, myOptions);`
include: {relation: 'department'}
}, myOptions);
if (args.dated < labour.started || (labour.ended != null && args.dated > labour.ended)) if (args.dated < labour.started || (labour.ended != null && args.dated > labour.ended))
throw new UserError(`The contract was not active during the selected date`); throw new UserError(`The contract was not active during the selected date`);