Merge branch 'develop'

This commit is contained in:
kittapath 2025-01-05 22:01:25 +07:00
commit d3a9f453c4
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,
);
}
}