From 840e6b997031a27f8416f4f72f56a34cbe7f6e95 Mon Sep 17 00:00:00 2001 From: Nick Charlton Date: Sun, 16 Jan 2022 21:21:40 +0000 Subject: [PATCH] fix: don't change org type for children --- src/controllers/organization.controller.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/controllers/organization.controller.ts b/src/controllers/organization.controller.ts index bbd62fa0..f9fa82a4 100644 --- a/src/controllers/organization.controller.ts +++ b/src/controllers/organization.controller.ts @@ -76,17 +76,13 @@ export class OrganizationController { @param.query.object('filter', getFilterSchemaFor(Organization)) filter?: OrganizationFilter, ): Promise { - // if logged in as an org-account then filter for the sub-orgs - if (organizationId && filter?.where) { - filter.where = { ...filter.where, type: 'o' }; - } - // create query to get all orgs and their planters if (filter?.where) { - filter.where = await this.organizationRepository.applyOrganizationWhereClause( - filter.where, - organizationId.valueOf(), - ); + filter.where = + await this.organizationRepository.applyOrganizationWhereClause( + filter.where, + organizationId.valueOf(), + ); } const childOrgs = await this.organizationRepository.find(filter);