From e00f22879c0ccd5deb9f9513bc63bc1cba45a08a Mon Sep 17 00:00:00 2001 From: Jordan Aasen <166539328+jaasen-livefront@users.noreply.github.com> Date: Thu, 31 Oct 2024 09:34:26 -0700 Subject: [PATCH] [PM-13947] - guard against call to undefined onSubmit (#11795) * guard against call to undefined function * revert input optional --- apps/web/src/app/billing/shared/payment/payment-v2.component.ts | 2 +- .../shared/verify-bank-account/verify-bank-account.component.ts | 2 +- .../manage-tax-information/manage-tax-information.component.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/src/app/billing/shared/payment/payment-v2.component.ts b/apps/web/src/app/billing/shared/payment/payment-v2.component.ts index 6c12b14cf0..c5ce4eac40 100644 --- a/apps/web/src/app/billing/shared/payment/payment-v2.component.ts +++ b/apps/web/src/app/billing/shared/payment/payment-v2.component.ts @@ -93,7 +93,7 @@ export class PaymentV2Component implements OnInit, OnDestroy { protected submit = async () => { const { type, token } = await this.tokenize(); - await this.onSubmit({ type, token }); + await this.onSubmit?.({ type, token }); this.submitted.emit(type); }; diff --git a/apps/web/src/app/billing/shared/verify-bank-account/verify-bank-account.component.ts b/apps/web/src/app/billing/shared/verify-bank-account/verify-bank-account.component.ts index 5a6a7b0cf3..2f9e34f877 100644 --- a/apps/web/src/app/billing/shared/verify-bank-account/verify-bank-account.component.ts +++ b/apps/web/src/app/billing/shared/verify-bank-account/verify-bank-account.component.ts @@ -35,7 +35,7 @@ export class VerifyBankAccountComponent { this.formGroup.value.amount1, this.formGroup.value.amount2, ); - await this.onSubmit(request); + await this.onSubmit?.(request); this.submitted.emit(); }; } diff --git a/libs/angular/src/billing/components/manage-tax-information/manage-tax-information.component.ts b/libs/angular/src/billing/components/manage-tax-information/manage-tax-information.component.ts index f048cf0d36..e73a696860 100644 --- a/libs/angular/src/billing/components/manage-tax-information/manage-tax-information.component.ts +++ b/libs/angular/src/billing/components/manage-tax-information/manage-tax-information.component.ts @@ -46,7 +46,7 @@ export class ManageTaxInformationComponent implements OnInit, OnDestroy { if (this.formGroup.invalid) { return; } - await this.onSubmit(this.taxInformation); + await this.onSubmit?.(this.taxInformation); this.taxInformationUpdated.emit(); };