diff --git a/src/controllers/KpiUserEvaluationController.ts b/src/controllers/KpiUserEvaluationController.ts index 79523a5..b1dd3a8 100644 --- a/src/controllers/KpiUserEvaluationController.ts +++ b/src/controllers/KpiUserEvaluationController.ts @@ -1629,7 +1629,10 @@ export class KpiUserEvaluationController extends Controller { pointSum: kpiUserEvaluation.summaryPoint, profileId: kpiUserEvaluation.profileId, }) - .then(async () => {}); + .then(async () => {}) + .catch((error) => { + console.error('Error details:', error.response.data); + }); kpiUserEvaluation.kpiUserDevelopments.map(async (kpiUserDevelopment) => { await new CallAPI() @@ -1652,20 +1655,26 @@ export class KpiUserEvaluationController extends Controller { developmentReport: kpiUserDevelopment.point != null ?kpiUserDevelopment.point.toString():null, developmentProjects: kpiUserDevelopment.developmentProjects.map((x) => x.name), }) - .then(async () => {}); + .then(async () => {}) + .catch((error) => { + console.error('Error details:', error.response.data); + }); }); - // await new CallAPI() - // .PostData(request, "/placement/noti/profile", { - // subject: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} ระดับผลการประเมินการปฏิบัติราชการระดับบุคคลของคุณอยู่ในเกณฑ์ ${kpiUserEvaluation.summaryPoint}`, - // body: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} ระดับผลการประเมินการปฏิบัติราชการระดับบุคคลของคุณอยู่ในเกณฑ์ ${kpiUserEvaluation.summaryPoint}`, - // receiverUserId: kpiUserEvaluation.profileId, - // payload: "", - // isSendMail: true, - // isSendInbox: true, - // isSendNotification: true, - // }) - // .then(async () => {}) - // .catch(() => {}); + + await new CallAPI() + .PostData(request, "/placement/noti/profile", { + subject: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} ระดับผลการประเมินการปฏิบัติราชการระดับบุคคลของคุณอยู่ในเกณฑ์ ${kpiUserEvaluation.summaryPoint}`, + body: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} ระดับผลการประเมินการปฏิบัติราชการระดับบุคคลของคุณอยู่ในเกณฑ์ ${kpiUserEvaluation.summaryPoint}`, + receiverUserId: kpiUserEvaluation.profileId, + payload: "", + isSendMail: true, + isSendInbox: true, + isSendNotification: true, + }) + .then(async () => {}) + .catch((error) => { + console.error('Error details:', error.response.data); + }); const before = null; kpiUserEvaluation.lastUpdateUserId = request.user.sub; kpiUserEvaluation.lastUpdateFullName = request.user.name;