add field salary(Current)
This commit is contained in:
parent
a7022b0cec
commit
d89c61e9ff
3 changed files with 28 additions and 4 deletions
|
|
@ -1741,7 +1741,12 @@ export class ProfileEmployeeController 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", "profileSalarys"],
|
||||
order: {
|
||||
profileSalarys: {
|
||||
order: "DESC",
|
||||
}
|
||||
}
|
||||
});
|
||||
if (!profile) {
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
|
||||
|
|
@ -1840,7 +1845,10 @@ export class ProfileEmployeeController extends Controller {
|
|||
? null
|
||||
: profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild4
|
||||
.orgChild4Name,
|
||||
};
|
||||
salary: profile && profile.profileSalarys.length > 0
|
||||
? profile.profileSalarys[0].amount
|
||||
: null
|
||||
};
|
||||
return new HttpSuccess(_profile);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue