add field salary(Current)

This commit is contained in:
Bright 2024-09-25 10:58:28 +07:00
parent a7022b0cec
commit d89c61e9ff
3 changed files with 28 additions and 4 deletions

View file

@ -3190,7 +3190,12 @@ export class ProfileController extends Controller {
async getProfileByKeycloak(@Request() request: { user: Record<string, any> }) {
const profile = await this.profileRepo.findOne({
where: { keycloak: request.user.sub },
relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot"],
relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot", "profileSalary"],
order: {
profileSalary: {
order: "DESC",
}
}
});
if (!profile) {
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
@ -3299,6 +3304,9 @@ export class ProfileController extends Controller {
child4ShortName: child4 == null ? null : child4.orgChild4ShortName,
node: null,
nodeId: null,
salary: profile && profile.profileSalary.length > 0
? profile.profileSalary[0].amount
: null
};
if (_profile.child4Id != null) {