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)