Skip to content

Commit

Permalink
Merge pull request #11556 from Expensify/marco-fixWorkspaceBankAccoun…
Browse files Browse the repository at this point in the history
…tStep2

[CP Staging] save routingNumber and accountNumber in connectBankAccountManually
  • Loading branch information
luacmartins authored Oct 4, 2022
2 parents 93587b1 + 17a224b commit 6c089c8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/libs/ReimbursementAccountUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function getDefaultStateForField(props, fieldName, defaultValue = '') {
function getBankAccountFields(props, fieldNames) {
return {
..._.pick(lodashGet(props, 'reimbursementAccount.achData'), ...fieldNames),
..._.pick(lodashGet(props, 'reimbursementAccountDraftValues'), ...fieldNames),
..._.pick(props.reimbursementAccountDraft, ...fieldNames),
};
}
Expand Down
9 changes: 9 additions & 0 deletions src/libs/actions/FormActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,16 @@ function setDraftValues(formID, draftValues) {
Onyx.merge(`${formID}DraftValues`, draftValues);
}

/**
* @param {String} formID
* @returns {String}
*/
function getDraftValuesKey(formID) {
return `${formID}DraftValues`;
}

export {
getDraftValuesKey,
setIsLoading,
setErrors,
setDraftValues,
Expand Down
4 changes: 4 additions & 0 deletions src/pages/ReimbursementAccount/CompanyStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import AddressForm from './AddressForm';
import ReimbursementAccountForm from './ReimbursementAccountForm';
import * as ReimbursementAccount from '../../libs/actions/ReimbursementAccount';
import * as ReimbursementAccountUtils from '../../libs/ReimbursementAccountUtils';
import * as FormActions from '../../libs/actions/FormActions';

const propTypes = {
...withLocalizePropTypes,
Expand Down Expand Up @@ -312,6 +313,9 @@ export default compose(
reimbursementAccountDraft: {
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT_DRAFT,
},
reimbursementAccountDraftValues: {
key: FormActions.getDraftValuesKey(ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM),
},
session: {
key: ONYXKEYS.SESSION,
},
Expand Down

0 comments on commit 6c089c8

Please sign in to comment.