1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-02 13:23:29 +01:00

[AC-1418] Use new model and service method

This commit is contained in:
Shane Melton 2023-06-27 16:34:56 -07:00
parent 4f71542a38
commit dc13c3aea0
No known key found for this signature in database

View File

@ -3,7 +3,7 @@ import { FormBuilder, Validators } from "@angular/forms";
import { Subject, takeUntil } from "rxjs";
import { OrganizationApiServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/organization/organization-api.service.abstraction";
import { OrganizationSubscriptionUpdateRequest } from "@bitwarden/common/billing/models/request/organization-subscription-update.request";
import { OrganizationSmSubscriptionUpdateRequest } from "@bitwarden/common/billing/models/request/organization-sm-subscription-update.request";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
@ -140,14 +140,17 @@ export class SecretsManagerAdjustSubscriptionComponent implements OnInit, OnDest
const serviceAccountAdjustment =
this.formGroup.value.serviceAccountCount - this.options.serviceAccountCount;
const request = OrganizationSubscriptionUpdateRequest.forSecretsManager(
const request = new OrganizationSmSubscriptionUpdateRequest(
seatAdjustment,
serviceAccountAdjustment,
this.formGroup.value.seatLimit,
this.formGroup.value.serviceAccountLimit
);
await this.organizationApiService.updatePasswordManagerSeats(this.organizationId, request);
await this.organizationApiService.updateSecretsManagerSubscription(
this.organizationId,
request
);
await this.platformUtilsService.showToast(
"success",