1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 09:43:23 +00:00

[AC-1404] incorrect pricing shows for 2019 teams customers (#6462)

* Refactor seat count calculation in subscription adjust component

* Defaulting additionalSeatCount to 0 when falsy
This commit is contained in:
Conner Turnbull
2023-10-04 08:29:20 -04:00
committed by GitHub
parent 462daab322
commit c411e1f03b
2 changed files with 16 additions and 6 deletions

View File

@@ -38,8 +38,10 @@ export class AdjustSubscription {
async submit() {
try {
const seatAdjustment = this.newSeatCount - this.currentSeatCount;
const request = new OrganizationSubscriptionUpdateRequest(seatAdjustment, this.newMaxSeats);
const request = new OrganizationSubscriptionUpdateRequest(
this.additionalSeatCount,
this.newMaxSeats
);
this.formPromise = this.organizationApiService.updatePasswordManagerSeats(
this.organizationId,
request
@@ -64,11 +66,19 @@ export class AdjustSubscription {
}
}
get additionalSeatCount(): number {
return this.newSeatCount ? this.newSeatCount - this.currentSeatCount : 0;
}
get additionalMaxSeatCount(): number {
return this.newMaxSeats ? this.newMaxSeats - this.currentSeatCount : 0;
}
get adjustedSeatTotal(): number {
return this.newSeatCount * this.seatPrice;
return this.additionalSeatCount * this.seatPrice;
}
get maxSeatTotal(): number {
return this.newMaxSeats * this.seatPrice;
return this.additionalMaxSeatCount * this.seatPrice;
}
}