From 7be1bc385f90465b34edbc91763166642a0636b5 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 14 Nov 2024 08:35:28 +0100 Subject: [PATCH] perf: refs #6924 deleted useless relation --- modules/worker/back/methods/worker/createAbsence.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/worker/back/methods/worker/createAbsence.js b/modules/worker/back/methods/worker/createAbsence.js index 036e2bef7..8e6380c3b 100644 --- a/modules/worker/back/methods/worker/createAbsence.js +++ b/modules/worker/back/methods/worker/createAbsence.js @@ -58,9 +58,7 @@ module.exports = Self => { if (!isSubordinate || (isSubordinate && userId == id && !isTeamBoss)) throw new UserError(`You don't have enough privileges`); - const labour = await models.WorkerLabour.findById(args.businessFk, { - include: {relation: 'department'} - }, myOptions); + const labour = await models.WorkerLabour.findById(args.businessFk, myOptions); if (args.dated < labour.started || (labour.ended != null && args.dated > labour.ended)) throw new UserError(`The contract was not active during the selected date`);