Skip to content

Commit

Permalink
Uses policyID to correctly generate bankAccountRout
Browse files Browse the repository at this point in the history
  • Loading branch information
abdel-h66 committed Sep 16, 2023
1 parent 3fe7ab1 commit 55d4bc9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pages/ReimbursementAccount/BankAccountStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import ScreenWrapper from '../../components/ScreenWrapper';
import StepPropTypes from './StepPropTypes';
import PressableWithoutFeedback from '../../components/Pressable/PressableWithoutFeedback';
import * as Link from '../../libs/actions/Link';
import { getBankAccountRoute } from '../../libs/ReportUtils';

const propTypes = {
...StepPropTypes,
Expand All @@ -49,6 +50,9 @@ const propTypes = {

/* The workspace name */
policyName: PropTypes.string,

/* The workspace ID */
policyID: PropTypes.string,
};

const defaultProps = {
Expand All @@ -57,6 +61,7 @@ const defaultProps = {
user: {},
isPlaidDisabled: false,
policyName: '',
policyID: '',
};

function BankAccountStep(props) {
Expand All @@ -66,7 +71,7 @@ function BankAccountStep(props) {
subStep = CONST.BANK_ACCOUNT.SETUP_TYPE.PLAID;
}
const plaidDesktopMessage = getPlaidDesktopMessage();
const bankAccountRoute = `${CONFIG.EXPENSIFY.NEW_EXPENSIFY_URL}${ROUTES.BANK_ACCOUNT}`;
const bankAccountRoute = `${CONFIG.EXPENSIFY.NEW_EXPENSIFY_URL}${ROUTES.getBankAccountRoute('new', props.policyID, ROUTES.getWorkspaceInitialRoute(props.policyID))}`;

if (subStep === CONST.BANK_ACCOUNT.SETUP_TYPE.MANUAL) {
return (
Expand Down
1 change: 1 addition & 0 deletions src/pages/ReimbursementAccount/ReimbursementAccountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ class ReimbursementAccountPage extends React.Component {
plaidLinkOAuthToken={this.props.plaidLinkToken}
getDefaultStateForField={this.getDefaultStateForField}
policyName={policyName}
policyID={policyID}
/>
);
}
Expand Down

0 comments on commit 55d4bc9

Please sign in to comment.