mirror of
https://github.com/anatolykopyl/vk-bingo.git
synced 2026-03-26 12:54:25 +00:00
🛂 Перенес проверку ответа на backend
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user