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()); }); }