From e847f964c53a832aed7724435c8d1a6ce32aa1a5 Mon Sep 17 00:00:00 2001 From: cyprain-okeke <108260115+cyprain-okeke@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:17:33 +0100 Subject: [PATCH] Fix the unclear error message on add payment (#13005) --- .../adjust-payment-dialog-v2.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/web/src/app/billing/shared/adjust-payment-dialog/adjust-payment-dialog-v2.component.ts b/apps/web/src/app/billing/shared/adjust-payment-dialog/adjust-payment-dialog-v2.component.ts index 0a72b8302b..e7c29591f0 100644 --- a/apps/web/src/app/billing/shared/adjust-payment-dialog/adjust-payment-dialog-v2.component.ts +++ b/apps/web/src/app/billing/shared/adjust-payment-dialog/adjust-payment-dialog-v2.component.ts @@ -99,6 +99,7 @@ export class AdjustPaymentDialogV2Component implements OnInit { submit = async (): Promise<void> => { if (!this.taxInfoComponent.validate()) { + this.taxInfoComponent.markAllAsTouched(); return; } @@ -117,10 +118,11 @@ export class AdjustPaymentDialogV2Component implements OnInit { this.dialogRef.close(AdjustPaymentDialogV2ResultType.Submitted); } catch (error) { + const msg = typeof error == "object" ? error.message : error; this.toastService.showToast({ variant: "error", title: null, - message: this.i18nService.t(error.message) || error.message, + message: this.i18nService.t(msg) || msg, }); } };