Skip to content

Commit

Permalink
Merge pull request #5975 from Expensify/aldo_fix-addresssearch-contra…
Browse files Browse the repository at this point in the history
…ct-step

Add AddressSearch related fields missing renaming in "Additional information" step
  • Loading branch information
HorusGoul authored Oct 25, 2021
2 parents 59f8a3a + 416222d commit 79ba0fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 8 additions & 1 deletion src/pages/ReimbursementAccount/BeneficialOwnersStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,15 @@ class BeneficialOwnersStep extends React.Component {
*/
clearErrorAndSetBeneficialOwnerValue(ownerIndex, inputKey, value) {
this.setState((prevState) => {
const renamedFields = {
addressStreet: 'street',
addressCity: 'city',
addressState: 'state',
addressZipCode: 'zipCode',
};
const renamedInputKey = lodashGet(renamedFields, inputKey, inputKey);
const beneficialOwners = [...prevState.beneficialOwners];
beneficialOwners[ownerIndex] = {...beneficialOwners[ownerIndex], [inputKey]: value};
beneficialOwners[ownerIndex] = {...beneficialOwners[ownerIndex], [renamedInputKey]: value};
updateReimbursementAccountDraft({beneficialOwners});
return {beneficialOwners};
});
Expand Down
4 changes: 0 additions & 4 deletions src/pages/ReimbursementAccount/RequestorStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ class RequestorStep extends React.Component {
*/
clearErrorAndSetValue(inputKey, value) {
const renamedFields = {
street: 'requestorAddressStreet',
city: 'requestorAddressCity',
state: 'requestorAddressState',
zipCode: 'requestorAddressZipCode',
addressStreet: 'requestorAddressStreet',
addressCity: 'requestorAddressCity',
addressState: 'requestorAddressState',
Expand Down

0 comments on commit 79ba0fb

Please sign in to comment.