Skip to content

Commit

Permalink
Merge pull request #1353 from Gary-Community-Ventures/bug/smaller_hou…
Browse files Browse the repository at this point in the history
…sehold_size

Truncate the household member list if the user chooses a smaller household member size
  • Loading branch information
CalebPena authored Nov 1, 2024
2 parents dc0876c + 580cbab commit 96ce31a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Components/Steps/HouseholdSize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,13 @@ const HouseholdSize = () => {
},
});

const formSubmitHandler: SubmitHandler<z.infer<typeof formSchema>> = async (householdSizeData) => {
const formSubmitHandler: SubmitHandler<z.infer<typeof formSchema>> = async ({ householdSize }) => {
if (uuid) {
const updatedFormData = { ...formData, ...householdSizeData };
const updatedFormData = {
...formData,
householdSize,
householdData: formData.householdData.slice(0, householdSize),
};
setFormData(updatedFormData);
await updateScreen(uuid, updatedFormData, locale);
nextStep();
Expand Down

0 comments on commit 96ce31a

Please sign in to comment.