diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index 96e64d34..6134d718 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -199,6 +199,7 @@ export class ProfileEmployeeController extends Controller { @Query() yearLeave?: number, @Query() isProbation?: boolean, @Query() isRetire?: boolean, + @Query() type?: string, ) { let queryLike = "CONCAT(profileEmployee.prefix, profileEmployee.firstName, ' ', profileEmployee.lastName) LIKE :keyword"; @@ -254,6 +255,14 @@ export class ProfileEmployeeController extends Controller { : `profile.dateRetire IS NOT NULL` : "1=1", ) + .andWhere( + type !== undefined && type !== null && type !== "" + ? "profileEmployee.employeeClass LIKE :type" + : "1=1", + { + type: `%${type}%`, + } + ) .skip((page - 1) * pageSize) .take(pageSize) .getManyAndCount();