From 062253a0510618984881887d53d8112437e10584 Mon Sep 17 00:00:00 2001 From: Aldo Canepa Date: Thu, 21 Oct 2021 09:55:04 -0700 Subject: [PATCH 1/2] Remove unused field rename entries --- src/pages/ReimbursementAccount/RequestorStep.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/pages/ReimbursementAccount/RequestorStep.js b/src/pages/ReimbursementAccount/RequestorStep.js index 413c14646ab4..c191271af5bd 100644 --- a/src/pages/ReimbursementAccount/RequestorStep.js +++ b/src/pages/ReimbursementAccount/RequestorStep.js @@ -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', From 416222dd8a40bb4bb7d7e212b406d40282d5f61c Mon Sep 17 00:00:00 2001 From: Aldo Canepa Date: Thu, 21 Oct 2021 09:55:35 -0700 Subject: [PATCH 2/2] Add missing field rename to beneficial owners step --- src/pages/ReimbursementAccount/BeneficialOwnersStep.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/pages/ReimbursementAccount/BeneficialOwnersStep.js b/src/pages/ReimbursementAccount/BeneficialOwnersStep.js index 13659a27d684..faf2a67216c1 100644 --- a/src/pages/ReimbursementAccount/BeneficialOwnersStep.js +++ b/src/pages/ReimbursementAccount/BeneficialOwnersStep.js @@ -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}; });