Skip to content

Commit

Permalink
truncate household members list to the length of the household size
Browse files Browse the repository at this point in the history
  • Loading branch information
CalebPena committed Oct 31, 2024
1 parent 9dd6447 commit 580cbab
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 580cbab

Please sign in to comment.