Skip to content
Snippets Groups Projects

Resolve "Show question components in editor"

Merged Emil Wahlqvist requested to merge 122-show-question-components-in-editor into dev
2 files
+ 5
3
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -29,14 +29,15 @@ const AnswerMultiple = ({ variant, activeSlide, competitionId }: AnswerMultipleP
}
const updateAnswer = async (alternative: QuestionAlternative) => {
// TODO: fix. Make list of alternatives and delete & post instead of put to allow multiple boxes checked.
if (activeSlide) {
if (team?.question_answers.find((answer) => answer.question_id === activeSlide.questions[0].id)) {
console.log('CHECKKKKKKKKKKK')
if (answer?.answer === alternative.text) {
// Uncheck checkbox
deleteAnswer()
} else {
// Check another box
// TODO
}
} else {
// Check first checkbox
@@ -60,7 +61,7 @@ const AnswerMultiple = ({ variant, activeSlide, competitionId }: AnswerMultipleP
const deleteAnswer = async () => {
await axios
.delete(`/api/competitions/${competitionId}/teams/${teamId}/answers`)
.delete(`/api/competitions/${competitionId}/teams/${teamId}/answers`) // TODO: fix
.then(() => {
dispatch(getEditorCompetition(competitionId))
})
Loading