From 3356ceb22ca2a655e292eafc48c1bd9fdf8b0207 Mon Sep 17 00:00:00 2001 From: Bright Date: Mon, 22 Apr 2024 13:39:34 +0700 Subject: [PATCH] no message --- src/controllers/KpiUserEvaluationController.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/controllers/KpiUserEvaluationController.ts b/src/controllers/KpiUserEvaluationController.ts index d227bf1..79e8983 100644 --- a/src/controllers/KpiUserEvaluationController.ts +++ b/src/controllers/KpiUserEvaluationController.ts @@ -24,7 +24,6 @@ import { KpiPeriod } from "../entities/kpiPeriod"; import { KpiUserEvaluation, createKpiUserEvaluation, updateKpiUserEvaluation } from "../entities/kpiUserEvaluation"; import { Like, In } from "typeorm"; import CallAPI from "../interfaces/call-api"; -import { Any } from "typeorm/browser"; @Route("api/v1/kpi/user/evaluation") @Tags("kpiUserEvaluation") @@ -166,9 +165,7 @@ export class KpiUserEvaluationController extends Controller { { lastName: Like(`%${keyword}%`) }, ], ) - .andWhere(period == undefined && period == null && period == "" - ? "1=1" - : { "kpiPeriod.durationKPI" : In([period]) }) + .andWhere(period ? "kpiPeriod.durationKPI LIKE :period" : "1=1", { period: `%${period}%` }) .orderBy("kpiUserEvaluation.createdAt", "ASC") .skip((page - 1) * pageSize) .take(pageSize)