ส่งฟิลด์ตำแหน่งทางการบริหาร #2195
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m0s

This commit is contained in:
harid 2026-01-15 11:49:08 +07:00
parent c4e6bafa4d
commit b8421d29ed

View file

@ -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,
};