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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user