mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 22:03:36 +00:00
Fix TaxService.previewTaxAmountForOrganizationTrial return type (#15848)
This commit is contained in:
@@ -304,6 +304,7 @@ export class TrialBillingStepComponent implements OnInit, OnDestroy {
|
|||||||
this.fetchingTaxAmount = true;
|
this.fetchingTaxAmount = true;
|
||||||
|
|
||||||
if (!this.taxInfoComponent.validate()) {
|
if (!this.taxInfoComponent.validate()) {
|
||||||
|
this.fetchingTaxAmount = false;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -326,7 +327,7 @@ export class TrialBillingStepComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
const response = await this.taxService.previewTaxAmountForOrganizationTrial(request);
|
const response = await this.taxService.previewTaxAmountForOrganizationTrial(request);
|
||||||
this.fetchingTaxAmount = false;
|
this.fetchingTaxAmount = false;
|
||||||
return response.taxAmount;
|
return response;
|
||||||
};
|
};
|
||||||
|
|
||||||
get price() {
|
get price() {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { PreviewIndividualInvoiceRequest } from "../models/request/preview-indiv
|
|||||||
import { PreviewOrganizationInvoiceRequest } from "../models/request/preview-organization-invoice.request";
|
import { PreviewOrganizationInvoiceRequest } from "../models/request/preview-organization-invoice.request";
|
||||||
import { PreviewTaxAmountForOrganizationTrialRequest } from "../models/request/tax";
|
import { PreviewTaxAmountForOrganizationTrialRequest } from "../models/request/tax";
|
||||||
import { PreviewInvoiceResponse } from "../models/response/preview-invoice.response";
|
import { PreviewInvoiceResponse } from "../models/response/preview-invoice.response";
|
||||||
import { PreviewTaxAmountResponse } from "../models/response/tax";
|
|
||||||
|
|
||||||
export abstract class TaxServiceAbstraction {
|
export abstract class TaxServiceAbstraction {
|
||||||
abstract getCountries(): CountryListItem[];
|
abstract getCountries(): CountryListItem[];
|
||||||
@@ -20,5 +19,5 @@ export abstract class TaxServiceAbstraction {
|
|||||||
|
|
||||||
abstract previewTaxAmountForOrganizationTrial: (
|
abstract previewTaxAmountForOrganizationTrial: (
|
||||||
request: PreviewTaxAmountForOrganizationTrialRequest,
|
request: PreviewTaxAmountForOrganizationTrialRequest,
|
||||||
) => Promise<PreviewTaxAmountResponse>;
|
) => Promise<number>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { PreviewTaxAmountForOrganizationTrialRequest } from "@bitwarden/common/billing/models/request/tax";
|
import { PreviewTaxAmountForOrganizationTrialRequest } from "@bitwarden/common/billing/models/request/tax";
|
||||||
import { PreviewTaxAmountResponse } from "@bitwarden/common/billing/models/response/tax";
|
|
||||||
|
|
||||||
import { ApiService } from "../../abstractions/api.service";
|
import { ApiService } from "../../abstractions/api.service";
|
||||||
import { TaxServiceAbstraction } from "../abstractions/tax.service.abstraction";
|
import { TaxServiceAbstraction } from "../abstractions/tax.service.abstraction";
|
||||||
@@ -306,13 +305,14 @@ export class TaxService implements TaxServiceAbstraction {
|
|||||||
|
|
||||||
async previewTaxAmountForOrganizationTrial(
|
async previewTaxAmountForOrganizationTrial(
|
||||||
request: PreviewTaxAmountForOrganizationTrialRequest,
|
request: PreviewTaxAmountForOrganizationTrialRequest,
|
||||||
): Promise<PreviewTaxAmountResponse> {
|
): Promise<number> {
|
||||||
return await this.apiService.send(
|
const response = await this.apiService.send(
|
||||||
"POST",
|
"POST",
|
||||||
"/tax/preview-amount/organization-trial",
|
"/tax/preview-amount/organization-trial",
|
||||||
request,
|
request,
|
||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
|
return response as number;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user