diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index 87bfa13..e3349f3 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -572,7 +572,9 @@ export class ReportController extends Controller { "AVG(kpiUserEvaluation.summaryPoint) as avgSummaryPoint" ]) .getRawMany(); - + if(!profileEvaluationNowYearIds || profileEvaluationNowYearIds.length === 0){ + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลรายงานการประเมินผลฯ ระดับบุคคลของบุคคลนี้"); + } // const profileEvaluations = await this.kpiUserEvaluationRepository.find({ // relations: ["kpiPeriod"], // where: { id: In(profileEvaluationNowYearIds.map((evaluation) => evaluation.id)) }, @@ -1500,6 +1502,9 @@ export class ReportController extends Controller { .groupBy("kpiUserEvaluation.kpiPeriodId") .select("MIN(kpiUserEvaluation.id) as id") .getRawMany(); + if(!profileEvaluationIds || profileEvaluationIds.length === 0){ + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลรายงานการประเมินผลฯ ระดับบุคคลของบุคคลนี้"); + } if (profileEvaluationIds.length > 0) { userInfo = await this.kpiUserEvaluationRepository.find({ where: { @@ -1532,7 +1537,6 @@ export class ReportController extends Controller { const dev20text = "การเรียนรู้จากผู้อื่น (Coach/Mentor/Consulting)"; const dev70text = "การลงมือปฏิบัติ (โดยผู้บังคับบัญชามอบหมาย)"; const combianText = [dev10text, dev20text, dev70text]; - formattedUserDevelopmentLists = userDevelopmentLists.map( (development: any, index: number) => ({ no: Extension.ToThaiNumber((index + 1).toString()),