When redeeming a F4E sponsorship, now filtering out organizations that the current user is not an owner of (#10013)

This commit is contained in:
Conner Turnbull 2024-07-10 16:16:50 -04:00 committed by GitHub
parent 3f0f5af26a
commit dbeab65ea5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import { first, map, takeUntil } from "rxjs/operators";
import { ApiService } from "@bitwarden/common/abstractions/api.service";
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
import { OrganizationUserType } from "@bitwarden/common/admin-console/enums";
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
import { OrganizationSponsorshipRedeemRequest } from "@bitwarden/common/admin-console/models/request/organization/organization-sponsorship-redeem.request";
import { PlanSponsorshipType, PlanType, ProductTierType } from "@bitwarden/common/billing/enums";
@ -95,7 +96,12 @@ export class FamiliesForEnterpriseSetupComponent implements OnInit, OnDestroy {
});
this.existingFamilyOrganizations$ = this.organizationService.organizations$.pipe(
map((orgs) => orgs.filter((o) => o.productTierType === ProductTierType.Families)),
map((orgs) =>
orgs.filter(
(o) =>
o.productTierType === ProductTierType.Families && o.type === OrganizationUserType.Owner,
),
),
);
this.existingFamilyOrganizations$.pipe(takeUntil(this._destroy)).subscribe((orgs) => {