From 2e6a4c88f37bc673692c3d6dcbd5c1d9da158dd8 Mon Sep 17 00:00:00 2001 From: Bright Date: Wed, 6 Nov 2024 16:20:53 +0700 Subject: [PATCH] =?UTF-8?q?fix=20=E0=B8=84=E0=B8=B3=E0=B8=AA=E0=B8=B1?= =?UTF-8?q?=E0=B9=88=E0=B8=87=E0=B8=9C=E0=B9=88=E0=B8=B2=E0=B8=99=E0=B8=97?= =?UTF-8?q?=E0=B8=94=E0=B8=A5=E0=B8=AD=E0=B8=87=E0=B8=B2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/CommandController.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index 5d9323d0..5f5918de 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -2468,6 +2468,7 @@ export class CommandController extends Controller { date: item.date, refCommandNo: item.refCommandNo, templateDoc: item.salaryRef, + commandId: item.commandId, position: profile.profileSalary.length > 0 ? profile.profileSalary[0].position : null, positionType: profile.profileSalary.length > 0 ? profile.profileSalary[0].positionType : null, @@ -2506,7 +2507,18 @@ export class CommandController extends Controller { await this.salaryHistoryRepo.save(history); }), ); - + const checkCommandType = await this.commandRepository.findOne({ + where: { id: (body.data.length > 0 ? body.data[0].commandId?.toString() : "") }, + relations: ["commandType"] + }); + if(checkCommandType?.commandType.code == "C-PM-11") { + const profile = await this.profileRepository.find({ where: { id: In(body.data.map(x => x.profileId)) } }); + const data = profile.map((x) => ({ + ...x, + isProbation: false, + })); + await this.profileRepository.save(data); + } return new HttpSuccess(); }