diff --git a/src/libs/actions/BankAccounts.js b/src/libs/actions/BankAccounts.js index 8ee14e693ba7..396cb83aee58 100644 --- a/src/libs/actions/BankAccounts.js +++ b/src/libs/actions/BankAccounts.js @@ -327,9 +327,10 @@ function openReimbursementAccountPage(stepToOpen, subStep, localCurrentStep) { * @param {String} [bankAccount.incorporationState] * @param {String} [bankAccount.incorporationDate] * @param {Boolean} [bankAccount.hasNoConnectionToCannabis] + * @param {String} policyID */ -function updateCompanyInformationForBankAccount(bankAccount) { - API.write('UpdateCompanyInformationForBankAccount', bankAccount, getVBBADataForOnyx()); +function updateCompanyInformationForBankAccount(bankAccount, policyID) { + API.write('UpdateCompanyInformationForBankAccount', {...bankAccount, policyID}, getVBBADataForOnyx()); } /** diff --git a/src/pages/ReimbursementAccount/CompanyStep.js b/src/pages/ReimbursementAccount/CompanyStep.js index a0982a725d63..b636486193b3 100644 --- a/src/pages/ReimbursementAccount/CompanyStep.js +++ b/src/pages/ReimbursementAccount/CompanyStep.js @@ -40,6 +40,9 @@ const propTypes = { /** Whether or not the user is on a public domain email account or not */ isFromPublicDomain: PropTypes.bool, }), + + /* The workspace policyID */ + policyID: PropTypes.string, }; const defaultProps = { @@ -47,6 +50,7 @@ const defaultProps = { email: null, }, user: {}, + policyID: '', }; class CompanyStep extends React.Component { @@ -148,7 +152,7 @@ class CompanyStep extends React.Component { companyPhone: parsePhoneNumber(values.companyPhone, {regionCode: CONST.COUNTRY.US}).number.significant, }; - BankAccounts.updateCompanyInformationForBankAccount(bankAccount); + BankAccounts.updateCompanyInformationForBankAccount(bankAccount, this.props.policyID); } render() { diff --git a/src/pages/ReimbursementAccount/ReimbursementAccountPage.js b/src/pages/ReimbursementAccount/ReimbursementAccountPage.js index 007457b21ee2..a07018ece1a9 100644 --- a/src/pages/ReimbursementAccount/ReimbursementAccountPage.js +++ b/src/pages/ReimbursementAccount/ReimbursementAccountPage.js @@ -330,6 +330,7 @@ class ReimbursementAccountPage extends React.Component { const achData = lodashGet(this.props.reimbursementAccount, 'achData', {}); const currentStep = achData.currentStep || CONST.BANK_ACCOUNT.STEP.BANK_ACCOUNT; const policyName = lodashGet(this.props.policy, 'name'); + const policyID = lodashGet(this.props.route.params, 'policyID'); if (_.isEmpty(this.props.policy) || !Policy.isPolicyOwner(this.props.policy)) { return ( @@ -423,6 +424,7 @@ class ReimbursementAccountPage extends React.Component { reimbursementAccountDraft={this.props.reimbursementAccountDraft} onBackButtonPress={this.goBack} getDefaultStateForField={this.getDefaultStateForField} + policyID={policyID} /> ); }