From f0d532e4bc5d6db9904f9cd502bcd3fa0c62e1a2 Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 13 Jul 2023 15:02:27 +0200 Subject: [PATCH] a --- modules/worker/front/card/index.js | 12 +++++++----- modules/worker/front/time-control/index.js | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/worker/front/card/index.js b/modules/worker/front/card/index.js index 35f331764..e03b94166 100644 --- a/modules/worker/front/card/index.js +++ b/modules/worker/front/card/index.js @@ -33,12 +33,14 @@ class Controller extends ModuleCard { }; this.$http.get(`Workers/${this.$params.id}`, {filter}) - .then(res => this.worker = res.data) - .then(() => + .then(res => { this.$http.get(`Workers/${this.$params.id}/activeContract`) - .then(res => { - if (res.data) this.worker.hasWorkCenter = res.data.workCenterFk; - })); + .then(activeContract => { + const worker = res.data; + if (activeContract.data) worker.hasWorkCenter = res.data.workCenterFk; + this.worker = worker; + }); + }); } } diff --git a/modules/worker/front/time-control/index.js b/modules/worker/front/time-control/index.js index 90ec33293..e90fbfeb0 100644 --- a/modules/worker/front/time-control/index.js +++ b/modules/worker/front/time-control/index.js @@ -151,7 +151,7 @@ class Controller extends Section { } getAbsences() { - if (!this.worker.hasWorkerCenter) return; + if (!this.worker.hasWorkCenter) return; const fullYear = this.started.getFullYear(); let params = { workerFk: this.$params.id,