diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index b3723fb1..3d299417 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -704,6 +704,12 @@ export class ProfileController extends Controller { throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบแบบร่างโครงสร้าง"); } + const posMaster = + profile.current_holders == null || + profile.current_holders.length == 0 || + profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id) == null + ? null + : profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id); const _profile: any = { profileId: profile.id, prefix: profile.prefix, @@ -712,6 +718,7 @@ export class ProfileController extends Controller { lastName: profile.lastName, citizenId: profile.citizenId, position: profile.position, + posMaster: posMaster == null ? null : posMaster.posMasterNo, posLevelName: profile.posLevel == null ? null : profile.posLevel.posLevelName, posLevelRank: profile.posLevel == null ? null : profile.posLevel.posLevelRank, posLevelId: profile.posLevel == null ? null : profile.posLevel.id,