Skip to content

Instantly share code, notes, and snippets.

@nicodevs
Last active November 18, 2025 17:39
Show Gist options
  • Select an option

  • Save nicodevs/6cab1fd705f48de14ff65553e29fe272 to your computer and use it in GitHub Desktop.

Select an option

Save nicodevs/6cab1fd705f48de14ff65553e29fe272 to your computer and use it in GitHub Desktop.
Changes

1. src/components/studentApplication/wizard/UniversalApplicationWizard.js

     setIsWorking(true);
     const updatedData = helpers.normalizeData({ ...wizardData, ...stepData });
+
+    copyFields(updatedData, fieldsToCopy); 
+
     setWizardData(updatedData);

     // Check if the selected state is a no fly state

copyFields is:

function copyFields(updatedData, mappings) {
  for (const { from, to } of mappings) {
    if (updatedData[from] && !updatedData[to]) {
      updatedData[to] = updatedData[from];
    }
  }
}

In the config send that new prop:

fieldsToCopy: [
  { from: "country", to: "personMailingCountryCode" },
  { from: "state", to: "personMailingState" }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment