From 6dfe7203d4ba2a7aded2d0f48346af94e6863ee9 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Wed, 8 May 2024 13:56:50 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=84=E0=B9=89=E0=B8=99=E0=B8=AB=E0=B8=B2?= =?UTF-8?q?=E0=B8=95=E0=B8=B2=E0=B8=A1=E0=B8=AA=E0=B8=96=E0=B8=B2=E0=B8=99?= =?UTF-8?q?=E0=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/KpiEvaluationController.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/controllers/KpiEvaluationController.ts b/src/controllers/KpiEvaluationController.ts index ee3eb52..9f6dcc6 100644 --- a/src/controllers/KpiEvaluationController.ts +++ b/src/controllers/KpiEvaluationController.ts @@ -72,6 +72,7 @@ export class kpiEvaluationController extends Controller { @Query("page") page: number = 1, @Query("pageSize") pageSize: number = 10, @Query("keyword") keyword?: string, + @Query("status") status?: string, ) { let whereClause: any = {}; @@ -84,6 +85,9 @@ export class kpiEvaluationController extends Controller { const [kpiEvaluation, total] = await this.kpiEvaluationRepository.findAndCount({ ...whereClause, + ...(status == null || status == undefined + ? {} + : { evaluationStatus: status.trim().toUpperCase() }), ...(keyword ? {} : { skip: (page - 1) * pageSize, take: pageSize }), order: { level: "DESC",