แก้ไข list กลุ่มงาน
This commit is contained in:
parent
5578bd4f18
commit
a64e20ac23
1 changed files with 9 additions and 4 deletions
|
|
@ -87,7 +87,6 @@ export class kpiGroupController extends Controller {
|
|||
if (chkkpinameGroup) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อกลุ่มงานนี้มีอยู่ในระบบแล้ว");
|
||||
}
|
||||
|
||||
this.kpiGroupRepository.merge(kpiGroup, requestBody);
|
||||
kpiGroup.lastUpdateUserId = request.user.sub;
|
||||
kpiGroup.lastUpdateFullName = request.user.name;
|
||||
|
|
@ -142,10 +141,16 @@ export class kpiGroupController extends Controller {
|
|||
@Query("pageSize") pageSize: number = 10,
|
||||
@Query("keyword") keyword?: string,
|
||||
) {
|
||||
let whereClause: any = {};
|
||||
|
||||
if (keyword !== undefined && keyword !== "") {
|
||||
whereClause = {
|
||||
where: [{ nameGroupKPI: Like(`%${keyword}%`) }],
|
||||
};
|
||||
}
|
||||
|
||||
const [kpiGroup, total] = await this.kpiGroupRepository.findAndCount({
|
||||
where: {
|
||||
nameGroupKPI: Like(`%${keyword}%`),
|
||||
},
|
||||
...whereClause,
|
||||
...(keyword ? {} : { skip: (page - 1) * pageSize, take: pageSize }),
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue