This commit is contained in:
AdisakKanthawilang 2024-06-14 10:49:53 +07:00
parent 152d813bb4
commit 7ed90ba142
2 changed files with 8 additions and 8 deletions

View file

@ -1948,7 +1948,7 @@ export class ProfileController extends Controller {
const take = pageSize; const take = pageSize;
switch (body.fieldName) { switch (body.fieldName) {
case "citizenId": case "citizenId":
[findProfile, total] = await this.profileRepo.find({ [findProfile, total] = await this.profileRepo.findAndCount({
where: { citizenId: Like(`%${body.keyword}%`) }, where: { citizenId: Like(`%${body.keyword}%`) },
relations: [ relations: [
"posType", "posType",
@ -1967,7 +1967,7 @@ export class ProfileController extends Controller {
break; break;
case "firstname": case "firstname":
[findProfile, total] = await this.profileRepo.find({ [findProfile, total] = await this.profileRepo.findAndCount({
where: { firstName: Like(`%${body.keyword}%`) }, where: { firstName: Like(`%${body.keyword}%`) },
relations: [ relations: [
"posType", "posType",
@ -1986,7 +1986,7 @@ export class ProfileController extends Controller {
break; break;
case "lastname": case "lastname":
[findProfile, total] = await this.profileRepo.find({ [findProfile, total] = await this.profileRepo.findAndCount({
where: { lastName: Like(`%${body.keyword}%`) }, where: { lastName: Like(`%${body.keyword}%`) },
relations: [ relations: [
"posType", "posType",
@ -2005,7 +2005,7 @@ export class ProfileController extends Controller {
break; break;
default: default:
[findProfile, total] = await this.profileRepo.find({ [findProfile, total] = await this.profileRepo.findAndCount({
relations: [ relations: [
"posType", "posType",
"posLevel", "posLevel",

View file

@ -1370,7 +1370,7 @@ export class ProfileEmployeeController extends Controller {
const take = pageSize; const take = pageSize;
switch (body.fieldName) { switch (body.fieldName) {
case "citizenId": case "citizenId":
[findProfile, total] = await this.profileRepo.find({ [findProfile, total] = await this.profileRepo.findAndCount({
where: { citizenId: Like(`%${body.keyword}%`) }, where: { citizenId: Like(`%${body.keyword}%`) },
relations: [ relations: [
"posType", "posType",
@ -1389,7 +1389,7 @@ export class ProfileEmployeeController extends Controller {
break; break;
case "firstname": case "firstname":
[findProfile, total] = await this.profileRepo.find({ [findProfile, total] = await this.profileRepo.findAndCount({
where: { firstName: Like(`%${body.keyword}%`) }, where: { firstName: Like(`%${body.keyword}%`) },
relations: [ relations: [
"posType", "posType",
@ -1408,7 +1408,7 @@ export class ProfileEmployeeController extends Controller {
break; break;
case "lastname": case "lastname":
[findProfile, total] = await this.profileRepo.find({ [findProfile, total] = await this.profileRepo.findAndCount({
where: { lastName: Like(`%${body.keyword}%`) }, where: { lastName: Like(`%${body.keyword}%`) },
relations: [ relations: [
"posType", "posType",
@ -1427,7 +1427,7 @@ export class ProfileEmployeeController extends Controller {
break; break;
default: default:
[findProfile, total] = await this.profileRepo.find({ [findProfile, total] = await this.profileRepo.findAndCount({
relations: [ relations: [
"posType", "posType",
"posLevel", "posLevel",