From 56cd94feaa8d0261054d4600761f0243d4b46025 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 2 Aug 2023 13:26:42 +0200 Subject: [PATCH] refs #5843 fix(timeControl_filter): not use userFk --- modules/worker/back/methods/worker-time-control/filter.js | 4 ++-- modules/worker/front/time-control/index.html | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/modules/worker/back/methods/worker-time-control/filter.js b/modules/worker/back/methods/worker-time-control/filter.js index 041c6cbfb..6d0880253 100644 --- a/modules/worker/back/methods/worker-time-control/filter.js +++ b/modules/worker/back/methods/worker-time-control/filter.js @@ -36,9 +36,9 @@ module.exports = Self => { if (isSubordinate === false) throw new UserError(`You don't have enough privileges`); - const subordinate = await Worker.findById(ctx.args.workerFk); + const subordinate = await Worker.findById(ctx.args.workerFk, {fields: ['id']}); filter = mergeFilters(filter, {where: { - userFk: subordinate.userFk + userFk: subordinate.id }}); return Self.find(filter); diff --git a/modules/worker/front/time-control/index.html b/modules/worker/front/time-control/index.html index 760b0dafc..b77acbddc 100644 --- a/modules/worker/front/time-control/index.html +++ b/modules/worker/front/time-control/index.html @@ -4,7 +4,7 @@ filter="::$ctrl.filter" data="$ctrl.hours"> -
+
@@ -106,12 +106,6 @@
-
- Autonomous worker -