Skip to content
Snippets Groups Projects
Commit 810de2c0 authored by Adam Parák's avatar Adam Parák 💬
Browse files

Merge branch 'qa-5' into 'main'

fix: reset answers to default when questions change

See merge request inject/frontend!244
parents 88e117d3 feac3377
No related branches found
No related tags found
No related merge requests found
...@@ -56,6 +56,15 @@ const TraineeQuestionnaireContent: FC<TraineeQuestionnaireContentProps> = ({ ...@@ -56,6 +56,15 @@ const TraineeQuestionnaireContent: FC<TraineeQuestionnaireContentProps> = ({
})) }))
) )
useEffect(() => {
setAnswers(
details.questions.map(question => ({
questionId: question.id,
choice: INVALID_CHOICE,
}))
)
}, [details.questions])
const [mutate] = useAnswerQuestionnaire({ const [mutate] = useAnswerQuestionnaire({
variables: { variables: {
questInput: { answers, questionnaireId: details.id, teamId }, questInput: { answers, questionnaireId: details.id, teamId },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment