diff --git a/src/controllers/OrganizationDotnetController.ts b/src/controllers/OrganizationDotnetController.ts index 19d9eb0c..9357d8af 100644 --- a/src/controllers/OrganizationDotnetController.ts +++ b/src/controllers/OrganizationDotnetController.ts @@ -1026,6 +1026,23 @@ export class OrganizationDotnetController extends Controller { oc = `${_profileCurrent.orgChild4?.orgChild4Name}`; } } + const position = await this.positionRepository.findOne({ + where: { + positionIsSelected: true, + posMaster: { + orgRevisionId: profile.current_holders.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.orgRevisionId, + current_holderId: profile.id, + }, + }, + order: { createdAt: "DESC" }, + relations: { + posExecutive: true, + }, + }); const mapProfile = { id: profile.id, avatar: profile.avatar, @@ -1178,6 +1195,9 @@ export class OrganizationDotnetController extends Controller { profileInsignia: profile.profileInsignias.length > 0 ? profile.profileInsignias[0] : null, profileType: "OFFICER", positionLeaveName: positionLeaveName, + posExecutiveName: position == null || position.posExecutive == null + ? null + : position.posExecutive.posExecutiveName, oc: oc, };