From b469ccd25a6412051bc4289916d24ef0cbc0591e Mon Sep 17 00:00:00 2001 From: Bright Date: Tue, 3 Sep 2024 10:48:54 +0700 Subject: [PATCH] no message --- src/controllers/OrganizationDotnetController.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 } }) );