From 181ec29d2abf5e424cd494c8db4d63b3d0d44514 Mon Sep 17 00:00:00 2001 From: kittapath Date: Tue, 4 Feb 2025 16:54:46 +0700 Subject: [PATCH] no message --- src/controllers/CommandController.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index ff88a6a4..cb8d16da 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -4926,17 +4926,15 @@ export class CommandController extends Controller { posMasters.map(async (item) => { if (item.posMasterChild != null && item.posMasterChild.current_holderId != null) { // ประวัติคำสั่งให้รักษาการแทน - const dataAct = new ProfileActposition(); const _actposition = await this.actpositionRepository.find({ where: { profileId: item.posMasterChild.current_holderId }, }); - const data = _actposition.map((_data) => ({ + const profileActs = _actposition.map((_data) => ({ ..._data, status: false, dateEnd: _data.status == true ? new Date() : _data.dateEnd, })); - await this.posMasterActRepository.save(data); - item.posMasterChild.current_holderId; + await this.actpositionRepository.save(profileActs); const shortName = item.posMaster != null && item.posMaster.orgChild4 != null @@ -4968,6 +4966,7 @@ export class CommandController extends Controller { lastUpdatedAt: new Date(), }; + const dataAct = new ProfileActposition(); Object.assign(dataAct, metaAct); const historyAct = new ProfileActpositionHistory(); Object.assign(historyAct, { ...dataAct, id: undefined });