Skip to content

Commit

Permalink
refactor: CheckBoxWithLabelForm to fit into Question Schema
Browse files Browse the repository at this point in the history
  • Loading branch information
toothlessdev committed Nov 22, 2024
1 parent 3944c3c commit eb1f30a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/components/forms/CheckBoxWithLabelForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,15 @@ export const CheckBoxWithLabelForm = ({
...formState,
[questionText]: [
...formState[questionText],
{ value: true },
{ value: option.value },
],
});
} else {
setFormState({
...formState,
[questionText]: [
...formState[questionText],
{ value: false },
],
[questionText]: formState[questionText].filter(
(state) => state.value !== option.value,
),
});
}
}}
Expand Down

0 comments on commit eb1f30a

Please sign in to comment.