fix search
This commit is contained in:
parent
69db570268
commit
09c47361f1
3 changed files with 24 additions and 15 deletions
|
|
@ -147,13 +147,13 @@ export class ProfileChangeNameController extends Controller {
|
||||||
profile.prefix = body.prefix ?? profile.prefix;
|
profile.prefix = body.prefix ?? profile.prefix;
|
||||||
await this.profileRepository.save(profile);
|
await this.profileRepository.save(profile);
|
||||||
|
|
||||||
// ปิดไว้ก่อนเพราะ error ต้องใช้ keycloak ที่มีสิทธิ์ในการ update
|
// ปิดไว้ก่อนเพราะ error ต้องใช้ keycloak ที่มีสิทธิ์ในการ update //update 17/07
|
||||||
// if (profile != null && profile.keycloak != null) {
|
if (profile != null && profile.keycloak != null) {
|
||||||
// const result = await updateName(profile.keycloak, profile.firstName, profile.lastName);
|
const result = await updateName(profile.keycloak, profile.firstName, profile.lastName);
|
||||||
// if (!result) {
|
if (!result) {
|
||||||
// throw new Error(result.errorMessage);
|
throw new Error(result.errorMessage);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
return new HttpSuccess(data.id);
|
return new HttpSuccess(data.id);
|
||||||
}
|
}
|
||||||
|
|
@ -200,13 +200,13 @@ export class ProfileChangeNameController extends Controller {
|
||||||
await this.profileRepository.save(profile);
|
await this.profileRepository.save(profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ปิดไว้ก่อนเพราะ error ต้องใช้ keycloak ที่มีสิทธิ์ในการ update
|
// ปิดไว้ก่อนเพราะ error ต้องใช้ keycloak ที่มีสิทธิ์ในการ update //update 17/07
|
||||||
// if (profile != null && profile.keycloak != null) {
|
if (profile != null && profile.keycloak != null) {
|
||||||
// const result = await updateName(profile.keycloak, profile.firstName, profile.lastName);
|
const result = await updateName(profile.keycloak, profile.firstName, profile.lastName);
|
||||||
// if (!result) {
|
if (!result) {
|
||||||
// throw new Error(result.errorMessage);
|
throw new Error(result.errorMessage);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@ import { Prefixe } from "../entities/Prefixe";
|
||||||
import { ProfileInsignia } from "../entities/ProfileInsignia";
|
import { ProfileInsignia } from "../entities/ProfileInsignia";
|
||||||
import { ProfileDisciplineHistory } from "../entities/ProfileDisciplineHistory";
|
import { ProfileDisciplineHistory } from "../entities/ProfileDisciplineHistory";
|
||||||
import { ProfileLeave } from "../entities/ProfileLeave";
|
import { ProfileLeave } from "../entities/ProfileLeave";
|
||||||
|
import { updateName } from "../keycloak";
|
||||||
|
|
||||||
@Route("api/v1/org/profile")
|
@Route("api/v1/org/profile")
|
||||||
@Tags("Profile")
|
@Tags("Profile")
|
||||||
|
|
@ -2321,6 +2322,13 @@ export class ProfileController extends Controller {
|
||||||
record.dateRetireLaw = calculateRetireLaw(record.birthDate);
|
record.dateRetireLaw = calculateRetireLaw(record.birthDate);
|
||||||
await this.profileRepo.save(record);
|
await this.profileRepo.save(record);
|
||||||
|
|
||||||
|
if (record != null && record.keycloak != null) {
|
||||||
|
const result = await updateName(record.keycloak, record.firstName, record.lastName);
|
||||||
|
if (!result) {
|
||||||
|
throw new Error(result.errorMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1329,7 +1329,8 @@ export class ProfileEmployeeController extends Controller {
|
||||||
.map((x) => x.next_holderId),
|
.map((x) => x.next_holderId),
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
.andWhere("profileEmployee.employeeClass = :employeeClass", {employeeClass:"PERM"})
|
||||||
.skip((requestBody.page - 1) * requestBody.pageSize)
|
.skip((requestBody.page - 1) * requestBody.pageSize)
|
||||||
.take(requestBody.pageSize)
|
.take(requestBody.pageSize)
|
||||||
.getManyAndCount();
|
.getManyAndCount();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue