diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 791a6139..16a1d002 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -306,6 +306,7 @@ export class ProfileController extends Controller { bloodGroup: null, posLevel: null, posType: null, + org: null }, ], total: 1, @@ -436,6 +437,40 @@ export class ProfileController extends Controller { _data.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgRoot == null) ? null : _data.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgRoot; + + const child1 = + _data.current_holders == null || + _data.current_holders.length == 0 || + _data.current_holders.find((x) => x.orgRevisionId == findRevision.id) == null + ? null + : _data.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgChild1; + + const child2 = + _data.current_holders == null || + _data.current_holders.length == 0 || + _data.current_holders.find((x) => x.orgRevisionId == findRevision.id) == null + ? null + : _data.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgChild2; + + const child3 = + _data.current_holders == null || + _data.current_holders.length == 0 || + _data.current_holders.find((x) => x.orgRevisionId == findRevision.id) == null + ? null + : _data.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgChild3; + + const child4 = + _data.current_holders == null || + _data.current_holders.length == 0 || + _data.current_holders.find((x) => x.orgRevisionId == findRevision.id) == null + ? null + : _data.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgChild4; + + let _child1 = child1 == null ? "" : `${child1.orgChild1Name}/` + let _child2 = child2 == null ? "" : `${child2.orgChild2Name}/` + let _child3 = child3 == null ? "" : `${child3.orgChild3Name}/` + let _child4 = child4 == null ? "" : `${child4.orgChild4Name}/` + return { id: _data.id, prefix: _data.prefix, @@ -454,6 +489,7 @@ export class ProfileController extends Controller { root: root == null ? null : root.orgRootName, orgRootShortName: root == null ? null : root.orgRootShortName, orgRevisionId: root == null ? null : root.orgRevisionId, + org: `${_child4}${_child3}${_child2}${_child1}${root?.orgRootName}`, }; }), );