From 8992698651711620adddc41781835ef4a22eca1f Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Fri, 15 Aug 2025 12:04:45 +0700 Subject: [PATCH] orgId --- src/controllers/PositionController.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index 166013de..c3cb0930 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -1466,6 +1466,7 @@ export class PositionController extends Controller { break; } let shortName = ""; + let orgId: any; if ( posMaster.orgRootId !== null && posMaster.orgChild1Id == null && @@ -1473,6 +1474,7 @@ export class PositionController extends Controller { posMaster.orgChild3Id == null ) { shortName = posMaster.orgRoot.orgRootShortName; + orgId = posMaster.orgRootId; } else if ( posMaster.orgRootId !== null && posMaster.orgChild1Id !== null && @@ -1480,6 +1482,7 @@ export class PositionController extends Controller { posMaster.orgChild3Id == null ) { shortName = posMaster.orgChild1.orgChild1ShortName; + orgId = posMaster.orgChild1Id; } else if ( posMaster.orgRootId !== null && posMaster.orgChild1Id !== null && @@ -1487,6 +1490,7 @@ export class PositionController extends Controller { posMaster.orgChild3Id == null ) { shortName = posMaster.orgChild2.orgChild2ShortName; + orgId = posMaster.orgChild2Id; } else if ( posMaster.orgRootId !== null && posMaster.orgChild1Id !== null && @@ -1494,6 +1498,7 @@ export class PositionController extends Controller { posMaster.orgChild3Id !== null ) { shortName = posMaster.orgChild3.orgChild3ShortName; + orgId = posMaster.orgChild3Id; } else if ( posMaster.orgRootId !== null && posMaster.orgChild1Id !== null && @@ -1501,6 +1506,7 @@ export class PositionController extends Controller { posMaster.orgChild3Id !== null ) { shortName = posMaster.orgChild4.orgChild4ShortName; + orgId = posMaster.orgChild4Id; } const positions = await this.positionRepository.find({ where: { posMasterId: posMaster.id }, @@ -1525,6 +1531,7 @@ export class PositionController extends Controller { isStaff: posMaster.isStaff, orgLevel: orgLevel, orgShortname: shortName, + orgId: orgId, isDirector: posMaster.isDirector, positionSign: posMaster.positionSign, positions: positions.map((position) => ({