perf: refs #6924 deleted useless relation
gitea/salix/pipeline/pr-dev This commit looks good
Details
gitea/salix/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
dcae6dfbb4
commit
7be1bc385f
|
@ -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);
|
||||||
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`);
|
||||||
|
|
Loading…
Reference in New Issue