diff --git a/src/controllers/KpiPlanController.ts b/src/controllers/KpiPlanController.ts index 69cf6c8..f4984e3 100644 --- a/src/controllers/KpiPlanController.ts +++ b/src/controllers/KpiPlanController.ts @@ -56,7 +56,10 @@ export class kpiPlanController extends Controller { .getOne(); if (!kpiPeriod) { // throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตัวชี้วัดตามตำแหน่งนี้"); - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลรอบการประเมินนี้ในปีงบประมาณ "+requestBody.year); + throw new HttpError( + HttpStatusCode.NOT_FOUND, + "ไม่พบข้อมูลรอบการประเมินนี้ในปีงบประมาณ " + requestBody.year, + ); } } await new CallAPI() @@ -421,6 +424,7 @@ export class kpiPlanController extends Controller { condition = "kpiPlan.child4Id LIKE :nodeId"; break; default: + condition = "1=1"; break; } parameters.nodeId = `%${requestBody.nodeId}%`; @@ -442,6 +446,7 @@ export class kpiPlanController extends Controller { condition = "kpiPlan.child4Id LIKE :nodeId"; break; default: + condition = "1=1"; break; } parameters.nodeId = `%${requestBody.nodeId}%`; diff --git a/src/controllers/KpiRoleController.ts b/src/controllers/KpiRoleController.ts index 04b80d8..e9a7217 100644 --- a/src/controllers/KpiRoleController.ts +++ b/src/controllers/KpiRoleController.ts @@ -56,7 +56,10 @@ export class kpiRoleController extends Controller { .getOne(); if (!kpiPeriod) { // throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตัวชี้วัดตามตำแหน่งนี้"); - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลรอบการประเมินนี้ในปีงบประมาณ "+requestBody.year); + throw new HttpError( + HttpStatusCode.NOT_FOUND, + "ไม่พบข้อมูลรอบการประเมินนี้ในปีงบประมาณ " + requestBody.year, + ); } } await new CallAPI() @@ -371,6 +374,7 @@ export class kpiRoleController extends Controller { condition = "kpiRole.child4Id LIKE :nodeId"; break; default: + condition = "1=1"; break; } parameters.nodeId = `%${requestBody.nodeId}%`; @@ -392,6 +396,7 @@ export class kpiRoleController extends Controller { condition = "kpiRole.child4Id LIKE :nodeId"; break; default: + condition = "1=1"; break; } parameters.nodeId = `%${requestBody.nodeId}%`;