diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index a000cd62..2f7b1568 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -931,9 +931,14 @@ export class ProfileController extends Controller { .leftJoinAndSelect("current_holder.posType", "posType") .where({ orgRevisionId: findRevision?.id, - orgRootId: body.rootId == null ? "1=1" : body.rootId, current_holderId: Not(IsNull()), }) + .orWhere( + body.rootId == null ? "1=1" : "posMaster.orgRootId = :rootId", + { + rootId: body.rootId, + }, + ) .andWhere( new Brackets((qb) => { qb.where(