From 536572d0e76373f0b393375bcdbf37dc352913e4 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Tue, 22 Apr 2025 16:11:45 +0700 Subject: [PATCH] fix --- src/controllers/EvaluationController.ts | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/controllers/EvaluationController.ts b/src/controllers/EvaluationController.ts index 2408bcf..85d892a 100644 --- a/src/controllers/EvaluationController.ts +++ b/src/controllers/EvaluationController.ts @@ -1790,19 +1790,22 @@ export class EvaluationController { await this.evaluationRepository.save(evaluation, { data: request }); setLogDataDiff(request, { before, after: evaluation }); - // const _director = await new CallAPI() - // .PostData(request, "/org/workflow/find/director/SYS_EVA_REQ", { - // refId: [evaluation.userId], - // }) - // .then((x) => {}) - // .catch((x) => {}); - // console.log("_director>>",_director); - + let _director: any; + await new CallAPI() + .PostData(request, "/org/workflow/find/director-with-keycloak/SYS_EVA_REQ", { + refId: [evaluation.userId], + }) + .then((x) => { + _director = x; + }) + .catch((x) => {}); + + await new CallAPI() .PostData(request, "/placement/noti/keycloak", { subject: `${evaluation.fullName} แบบประเมินมีการบันทึกตรวจสอบจัดเตรียมเอกสารเล่ม 1`, body: `${evaluation.fullName} แบบประเมินมีการบันทึกตรวจสอบจัดเตรียมเอกสารเล่ม 1`, - receiverUserId: "59134ef9-9e62-41d0-aac5-339be727f2b0", + receiverUserId: _director.id, payload: "", isSendMail: true, isSendInbox: true, @@ -1810,6 +1813,7 @@ export class EvaluationController { }) .then((x) => {}) .catch((x) => {}); + return new HttpSuccess(); } catch (error: any) { if (error instanceof HttpError) { @@ -2837,6 +2841,7 @@ export class EvaluationController { "commanderAbovePositionDoc2", "commanderAbovePositionOldDoc2", "evaluationResult", + "isUpdated", ], }); if (!evaluation) { @@ -2880,6 +2885,7 @@ export class EvaluationController { "commanderAbovePositionDoc2", "commanderAbovePositionOldDoc2", "evaluationResult", + "isUpdated", ], }); if (!evaluation) {