diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 92e48350..96ff31f0 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -1948,7 +1948,7 @@ export class ProfileController extends Controller { const take = pageSize; switch (body.fieldName) { case "citizenId": - [findProfile, total] = await this.profileRepo.find({ + [findProfile, total] = await this.profileRepo.findAndCount({ where: { citizenId: Like(`%${body.keyword}%`) }, relations: [ "posType", @@ -1967,7 +1967,7 @@ export class ProfileController extends Controller { break; case "firstname": - [findProfile, total] = await this.profileRepo.find({ + [findProfile, total] = await this.profileRepo.findAndCount({ where: { firstName: Like(`%${body.keyword}%`) }, relations: [ "posType", @@ -1986,7 +1986,7 @@ export class ProfileController extends Controller { break; case "lastname": - [findProfile, total] = await this.profileRepo.find({ + [findProfile, total] = await this.profileRepo.findAndCount({ where: { lastName: Like(`%${body.keyword}%`) }, relations: [ "posType", @@ -2005,7 +2005,7 @@ export class ProfileController extends Controller { break; default: - [findProfile, total] = await this.profileRepo.find({ + [findProfile, total] = await this.profileRepo.findAndCount({ relations: [ "posType", "posLevel", diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index 338f65c6..e2880e78 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -1370,7 +1370,7 @@ export class ProfileEmployeeController extends Controller { const take = pageSize; switch (body.fieldName) { case "citizenId": - [findProfile, total] = await this.profileRepo.find({ + [findProfile, total] = await this.profileRepo.findAndCount({ where: { citizenId: Like(`%${body.keyword}%`) }, relations: [ "posType", @@ -1389,7 +1389,7 @@ export class ProfileEmployeeController extends Controller { break; case "firstname": - [findProfile, total] = await this.profileRepo.find({ + [findProfile, total] = await this.profileRepo.findAndCount({ where: { firstName: Like(`%${body.keyword}%`) }, relations: [ "posType", @@ -1408,7 +1408,7 @@ export class ProfileEmployeeController extends Controller { break; case "lastname": - [findProfile, total] = await this.profileRepo.find({ + [findProfile, total] = await this.profileRepo.findAndCount({ where: { lastName: Like(`%${body.keyword}%`) }, relations: [ "posType", @@ -1427,7 +1427,7 @@ export class ProfileEmployeeController extends Controller { break; default: - [findProfile, total] = await this.profileRepo.find({ + [findProfile, total] = await this.profileRepo.findAndCount({ relations: [ "posType", "posLevel",