diff --git a/src/controllers/OrganizationDotnetController.ts b/src/controllers/OrganizationDotnetController.ts index 969d9ebe..ed9473f6 100644 --- a/src/controllers/OrganizationDotnetController.ts +++ b/src/controllers/OrganizationDotnetController.ts @@ -3012,6 +3012,7 @@ export class OrganizationDotnetController extends Controller { node: number; nodeId: string; isAll: boolean; + isRetirement?: boolean; }, ) { let typeCondition: any = {}; @@ -3064,7 +3065,7 @@ export class OrganizationDotnetController extends Controller { }; } } - const profile = await this.profileRepo.find({ + let profile = await this.profileRepo.find({ where: { keycloak: Not(IsNull()) || Not(""), isLeave: false, current_holders: typeCondition }, relations: [ "posType", @@ -3077,7 +3078,22 @@ export class OrganizationDotnetController extends Controller { "current_holders.orgChild4", ], }); - + if(body.isRetirement){ + profile = await this.profileRepo.find({ + where: { keycloak: Not(IsNull()) || Not(""), isLeave: false, current_holders: typeCondition, isRetirement: true }, + relations: [ + "posType", + "posLevel", + "current_holders", + "current_holders.orgRoot", + "current_holders.orgChild1", + "current_holders.orgChild2", + "current_holders.orgChild3", + "current_holders.orgChild4", + ], + }); + } + const findRevision = await this.orgRevisionRepo.findOne({ where: { orgRevisionIsCurrent: true }, });