diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index 7022d310..88051bbc 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -2593,7 +2593,18 @@ export class CommandController extends Controller { body.data.map(async (item) => { if (item.profileType && item.profileType.trim().toUpperCase() == "OFFICER") { const profile = await this.profileRepository.findOne({ - relations: ["profileSalary", "posLevel", "posType", "current_holders", "roleKeycloaks"], + relations: [ + "profileSalary", + "posLevel", + "posType", + "current_holders", + "current_holders.orgRoot", + "current_holders.orgChild1", + "current_holders.orgChild2", + "current_holders.orgChild3", + "current_holders.orgChild4", + "roleKeycloaks", + ], where: { id: item.profileId }, order: { profileSalary: { @@ -2751,7 +2762,18 @@ export class CommandController extends Controller { } } else { const profile = await this.profileEmployeeRepository.findOne({ - relations: ["profileSalary", "posLevel", "posType", "current_holders", "roleKeycloaks"], + relations: [ + "profileSalary", + "posLevel", + "posType", + "current_holders", + "current_holders.orgRoot", + "current_holders.orgChild1", + "current_holders.orgChild2", + "current_holders.orgChild3", + "current_holders.orgChild4", + "roleKeycloaks", + ], where: { id: item.profileId }, order: { profileSalary: { @@ -2947,7 +2969,18 @@ export class CommandController extends Controller { await Promise.all( body.data.map(async (item) => { const profile = await this.profileEmployeeRepository.findOne({ - relations: ["profileSalary", "posLevel", "posType", "current_holders", "roleKeycloaks"], + relations: [ + "profileSalary", + "posLevel", + "posType", + "current_holders", + "current_holders.orgRoot", + "current_holders.orgChild1", + "current_holders.orgChild2", + "current_holders.orgChild3", + "current_holders.orgChild4", + "roleKeycloaks", + ], where: { id: item.profileId }, order: { profileSalary: { @@ -3275,6 +3308,11 @@ export class CommandController extends Controller { "posType", "posLevel", "current_holders", + "current_holders.orgRoot", + "current_holders.orgChild1", + "current_holders.orgChild2", + "current_holders.orgChild3", + "current_holders.orgChild4", "current_holders.positions", "current_holders.positions.posExecutive", ],