ค้นหาตามสถานะ

This commit is contained in:
Kittapath 2024-05-08 13:56:50 +07:00
parent 30636c482d
commit 6dfe7203d4

View file

@ -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",