Fixed sentence header mapping

This commit is contained in:
Joao Ramos
2024-07-17 23:00:16 +01:00
parent 15f9fb320d
commit 4996417218

View File

@@ -39,17 +39,14 @@ const MatchSentencesEdit = (props: Props) => {
label={`Sentence ${index + 1}`} label={`Sentence ${index + 1}`}
name="sentence" name="sentence"
required required
value={sentence.sentence.heading} value={sentence.sentence}
onChange={(value) => onChange={(value) =>
updateExercise({ updateExercise({
sentences: exercise.sentences.map((iSol) => sentences: exercise.sentences.map((iSol) =>
iSol.id === sentence.id iSol.id === sentence.id
? { ? {
...iSol, ...iSol,
sentence: { sentence: value,
...iSol.sentence,
heading: value,
},
} }
: iSol : iSol
), ),