From 5e361e375bcba42c3300c12222111a12ac218ed4 Mon Sep 17 00:00:00 2001 From: kittapath Date: Mon, 28 Oct 2024 14:36:20 +0700 Subject: [PATCH] no message --- src/controllers/CommandController.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index 8215ffdc..c507e3a9 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -2932,9 +2932,9 @@ export class CommandController extends Controller { ) { await Promise.all( body.refIds.map(async (item) => { - const profile = await this.profileEmployeeRepository.findOne({ + const profile = await this.posMasterRepository.findOne({ where: { id: item.refId }, - relations: ["posType", "posLevel"], + relations: ["current_holder", "current_holder.posType", "current_holder.posLevel"], }); if (!profile) { throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว"); @@ -2955,9 +2955,9 @@ export class CommandController extends Controller { positionSalaryAmount: item.positionSalaryAmount, mouthSalaryAmount: item.mouthSalaryAmount, posNo: "", - position: profile.position, - positionType: profile.posType?.posTypeName || null, - positionLevel: profile.posLevel?.posLevelName || null, + position: profile.current_holder?.position || null, + positionType: profile.current_holder?.posType?.posTypeName || null, + positionLevel: profile.current_holder?.posLevel?.posLevelName || null, refCommandNo: `${item.commandNo}/${Extension.ToThaiYear(item.commandYear)}`, templateDoc: item.templateDoc, order: dest_item == null ? 1 : dest_item.order + 1,