From 8f34253b902ba9ad4a89046ad148135f1a45cbcf Mon Sep 17 00:00:00 2001 From: Hghtwr Date: Tue, 28 May 2024 09:26:59 +0200 Subject: [PATCH] Satisfy Typecheck for user/groups by restructuring the if clause Signed-off-by: Hghtwr --- .../src/providers/GitlabOrgDiscoveryEntityProvider.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts b/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts index 67a5134f25..ce545ebe84 100644 --- a/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts +++ b/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts @@ -368,9 +368,7 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider { per_page: 100, }, ); - } - - if ( + } else if ( this.gitLabClient.isSelfManaged() && !this.config.restrictUsersToGroup ) { @@ -387,9 +385,8 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider { { page: 1, per_page: 100, active: true }, ); } - // For SaaS, the only difference is the root group - if (!this.gitLabClient.isSelfManaged()) { + else { groups = (await this.gitLabClient.listDescendantGroups(this.config.group)) .items; const rootGroup = this.config.restrictUsersToGroup