Satisfy Typecheck for user/groups by restructuring the if clause

Signed-off-by: Hghtwr <johannes.sonner@outlook.com>
This commit is contained in:
Hghtwr
2024-05-28 09:26:59 +02:00
committed by Johannes Sonner
parent 70500dd306
commit 8f34253b90
@@ -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