From f82b889e0e4b3fe9eae15307e9a874ccbd625594 Mon Sep 17 00:00:00 2001 From: GandalfGwaihir Date: Mon, 22 Apr 2024 04:23:50 +0530 Subject: [PATCH] Delete bank account along with resetting it --- src/pages/workspace/WorkspaceResetBankAccountModal.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceResetBankAccountModal.tsx b/src/pages/workspace/WorkspaceResetBankAccountModal.tsx index e7a8ce307816..03ddae766ee6 100644 --- a/src/pages/workspace/WorkspaceResetBankAccountModal.tsx +++ b/src/pages/workspace/WorkspaceResetBankAccountModal.tsx @@ -49,7 +49,12 @@ function WorkspaceResetBankAccountModal({reimbursementAccount, session, user}: W } danger onCancel={BankAccounts.cancelResetFreePlanBankAccount} - onConfirm={() => BankAccounts.resetFreePlanBankAccount(bankAccountID, session, achData?.policyID ?? '', user)} + onConfirm={() => { + BankAccounts.resetFreePlanBankAccount(bankAccountID, session, achData?.policyID ?? '', user); + if (bankAccountID) { + BankAccounts.deletePaymentBankAccount(bankAccountID); + } + }} shouldShowCancelButton isVisible />