diff --git a/src/components/Form.js b/src/components/Form.js index b20ddc59c3f69..2b441f294c3b1 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -229,7 +229,7 @@ export default compose( key: props => props.formID, }, draftValues: { - key: props => `${props.formID}DraftValues`, + key: props => `${props.formID}Draft`, }, }), )(Form); diff --git a/src/libs/ReimbursementAccountUtils.js b/src/libs/ReimbursementAccountUtils.js index 2e6570880233b..4074f1e8ab6c6 100644 --- a/src/libs/ReimbursementAccountUtils.js +++ b/src/libs/ReimbursementAccountUtils.js @@ -35,7 +35,6 @@ 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), }; } diff --git a/src/libs/actions/FormActions.js b/src/libs/actions/FormActions.js index bb13e6dddac36..e81b8d28ace77 100644 --- a/src/libs/actions/FormActions.js +++ b/src/libs/actions/FormActions.js @@ -21,19 +21,10 @@ function setErrors(formID, errors) { * @param {Object} draftValues */ function setDraftValues(formID, draftValues) { - Onyx.merge(`${formID}DraftValues`, draftValues); -} - -/** - * @param {String} formID - * @returns {String} - */ -function getDraftValuesKey(formID) { - return `${formID}DraftValues`; + Onyx.merge(`${formID}Draft`, draftValues); } export { - getDraftValuesKey, setIsLoading, setErrors, setDraftValues, diff --git a/src/pages/ReimbursementAccount/CompanyStep.js b/src/pages/ReimbursementAccount/CompanyStep.js index 4c806b821f7e3..29ea6bfea723e 100644 --- a/src/pages/ReimbursementAccount/CompanyStep.js +++ b/src/pages/ReimbursementAccount/CompanyStep.js @@ -26,7 +26,6 @@ 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, @@ -313,9 +312,6 @@ export default compose( reimbursementAccountDraft: { key: ONYXKEYS.REIMBURSEMENT_ACCOUNT_DRAFT, }, - reimbursementAccountDraftValues: { - key: FormActions.getDraftValuesKey(ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM), - }, session: { key: ONYXKEYS.SESSION, },