fix search
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m3s

This commit is contained in:
Adisak 2026-05-26 18:34:47 +07:00
parent 9288c9e833
commit 8b08f8b5c8
3 changed files with 5 additions and 5 deletions

View file

@ -1156,7 +1156,7 @@ export class EmployeePositionController extends Controller {
...(body.keyword &&
(masterId.length > 0
? { id: In(masterId) }
: keywordAsInt != null ? { posMasterNo: keywordAsInt } : {})),
: /^\d+$/.test(body.keyword) ? { posMasterNo: keywordAsInt } : { posMasterNo: Like(`%${body.keyword}%`) })),
},
];

View file

@ -875,7 +875,7 @@ export class EmployeeTempPositionController extends Controller {
...(body.keyword &&
(masterId.length > 0
? { id: In(masterId) }
: keywordAsInt != null ? { posMasterNo: keywordAsInt } : {})),
: /^\d+$/.test(body.keyword) ? { posMasterNo: keywordAsInt } : { posMasterNo: Like(`%${body.keyword}%`) })),
},
];
let query = AppDataSource.getRepository(EmployeeTempPosMaster)

View file

@ -1821,7 +1821,7 @@ export class PositionController extends Controller {
...(body.keyword &&
(masterId.length > 0
? { id: In(masterId) }
: keywordAsInt != null ? { posMasterNo: keywordAsInt } : {})),
: /^\d+$/.test(body.keyword) ? { posMasterNo: keywordAsInt } : { posMasterNo: Like(`%${body.keyword}%`) })),
},
];
let [posMaster, total] = await AppDataSource.getRepository(PosMaster)
@ -2277,7 +2277,7 @@ export class PositionController extends Controller {
...(body.keyword &&
(masterId.length > 0
? { id: In(masterId) }
: keywordAsInt != null ? { posMasterNo: keywordAsInt } : {})),
: /^\d+$/.test(body.keyword) ? { posMasterNo: keywordAsInt } : { posMasterNo: Like(`%${body.keyword}%`) })),
},
];
@ -5502,7 +5502,7 @@ export class PositionController extends Controller {
...(body.keyword &&
(masterId.length > 0
? { id: In(masterId) }
: keywordAsInt != null ? { posMasterNo: keywordAsInt } : {})),
: /^\d+$/.test(body.keyword) ? { posMasterNo: keywordAsInt } : { posMasterNo: Like(`%${body.keyword}%`) })),
...(!body.isAll && { isCondition: true }),
},
];