🛂 Перенес проверку ответа на backend

This commit is contained in:
2022-01-13 00:02:29 +03:00
parent 847ebae182
commit 393cbfdf8d
4 changed files with 53 additions and 25 deletions

View File

@@ -69,7 +69,6 @@ export default {
}
},
selectAnswer: function(selection) {
this.correctAnswer = selection === this.card.name
this.selectedAnswer = selection
let innerThis = this
setTimeout(function() {
@@ -84,10 +83,15 @@ export default {
axios
.post(process.env.VUE_APP_BACKEND + '/answer', {
'data': {
'correct': this.correctAnswer,
'selected': this.selectedAnswer
'id': this.card._id,
'name': this.selectedAnswer
}
})
.then((response) => {
this.correctAnswer = response.data.correct
this.card.name = response.data.name
this.card.date = response.data.date
})
}
},
mounted() {