From 40dd9161a4e4c161953a6a81930b865bbbf30e57 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Wed, 27 Apr 2022 14:03:33 -0600 Subject: [PATCH] rm deleteFromBankAccountList and redirect user --- .../ReimbursementAccount/resetFreePlanBankAccount.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libs/actions/ReimbursementAccount/resetFreePlanBankAccount.js b/src/libs/actions/ReimbursementAccount/resetFreePlanBankAccount.js index d4a596cf780d..dc16d35970cb 100644 --- a/src/libs/actions/ReimbursementAccount/resetFreePlanBankAccount.js +++ b/src/libs/actions/ReimbursementAccount/resetFreePlanBankAccount.js @@ -5,7 +5,8 @@ import * as API from '../../API'; import CONST from '../../../CONST'; import * as store from './store'; import Growl from '../../Growl'; -import deleteFromBankAccountList from './deleteFromBankAccountList'; +import Navigation from '../../Navigation/Navigation'; +import ROUTES from '../../../ROUTES'; /** * Reset user's reimbursement account. This will delete the bank account. @@ -32,7 +33,7 @@ function resetFreePlanBankAccount() { return; } - // Reset reimbursement account, and clear draft user input, and the bank account list + // Reset reimbursement account, and clear draft user input const achData = { useOnfido: true, policyID: '', @@ -41,12 +42,12 @@ function resetFreePlanBankAccount() { currentStep: CONST.BANK_ACCOUNT.STEP.BANK_ACCOUNT, }; - deleteFromBankAccountList(bankAccountID); Onyx.set(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {achData}); Onyx.set(ONYXKEYS.REIMBURSEMENT_ACCOUNT_DRAFT, null); - // Clear the NVP for the bank account so the user can add a new one + // Clear the NVP for the bank account so the user can add a new one and navigate back to bank account page API.SetNameValuePair({name: CONST.NVP.FREE_PLAN_BANK_ACCOUNT_ID, value: ''}); + Navigation.navigate(ROUTES.getBankAccountRoute()); }); }