diff --git a/src/controllers/OrganizationDotnetController.ts b/src/controllers/OrganizationDotnetController.ts index 3db55ca4..b294021f 100644 --- a/src/controllers/OrganizationDotnetController.ts +++ b/src/controllers/OrganizationDotnetController.ts @@ -803,6 +803,7 @@ export class OrganizationDotnetController extends Controller { "posType", "posLevel", "current_holders", + "current_holders.orgRoot", "current_holders.orgChild1", "current_holders.orgChild2", "current_holders.orgChild3", @@ -822,6 +823,10 @@ export class OrganizationDotnetController extends Controller { const profile_ = await Promise.all( profile.map((item: Profile) => { + const rootName = + item.current_holders.length == 0 + ? null + : item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.orgRoot?.orgRootName; const shortName = item.current_holders.length == 0 ? null @@ -849,6 +854,7 @@ export class OrganizationDotnetController extends Controller { : null; return { + oc: rootName, id: item.id, createdAt: item.createdAt, createdUserId: item.createdUserId, @@ -903,7 +909,7 @@ export class OrganizationDotnetController extends Controller { positionLevel: item.profileSalary.length > 0 ? item.profileSalary[0].positionLevel : null, - posNo: shortName + posNo: shortName } }) );