This commit is contained in:
AdisakKanthawilang 2024-12-27 15:16:29 +07:00
parent 141c029fa5
commit b512bf64f1
2 changed files with 4 additions and 2 deletions

View file

@ -59,11 +59,12 @@ export class kpiPlanController extends Controller {
.where("kpiPeriod.year = :year", { year: requestBody.year })
.andWhere("kpiPeriod.durationKPI = :durationKPI", { durationKPI: requestBody.period })
.getOne();
const year = requestBody.year && parseInt(requestBody.year) > 0?parseInt(requestBody.year) + 543:"ดังกล่าว";
if (!kpiPeriod) {
// throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตัวชี้วัดตามตำแหน่งนี้");
throw new HttpError(
HttpStatusCode.NOT_FOUND,
"ไม่พบข้อมูลรอบการประเมินนี้ในปีงบประมาณ " + requestBody.year,
"ไม่พบข้อมูลรอบการประเมินนี้ในปีงบประมาณ" + year,
);
}
}

View file

@ -53,10 +53,11 @@ export class kpiRoleController extends Controller {
.where("kpiPeriod.year = :year", { year: requestBody.year })
.andWhere("kpiPeriod.durationKPI = :durationKPI", { durationKPI: requestBody.period })
.getOne();
const year = requestBody.year && parseInt(requestBody.year) > 0?parseInt(requestBody.year) + 543:"ดังกล่าว";
if (!kpiPeriod) {
throw new HttpError(
HttpStatusCode.NOT_FOUND,
"ไม่พบข้อมูลรอบการประเมินนี้ในปีงบประมาณ " + (requestBody.year + 543),
"ไม่พบข้อมูลรอบการประเมินนี้ในปีงบประมาณ" + year,
);
}
}