From 56f4d0d4f51893a652b2c9841b0ce1d7e592115d Mon Sep 17 00:00:00 2001 From: Kittapath Date: Tue, 6 Aug 2024 09:03:51 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20search=20api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/KpiPlanController.ts | 7 ++++++- src/controllers/KpiRoleController.ts | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) 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}%`;