Implement UpdateAnswer functionality on the client
This commit is contained in:
parent
f602f78604
commit
3abec8ccda
1 changed files with 4 additions and 4 deletions
|
|
@ -126,13 +126,13 @@ export default {
|
||||||
*/
|
*/
|
||||||
let team = this.$store.state.team;
|
let team = this.$store.state.team;
|
||||||
let data = {
|
let data = {
|
||||||
|
game_code: this.$store.state.game_code,
|
||||||
team: team,
|
team: team,
|
||||||
answer: answerIndex,
|
answer: answerIndex,
|
||||||
value: this.answers[`team_${team}`][answerIndex - 1]
|
value: this.answers[`team_${team}`][answerIndex - 1]
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO -> Send data to socket.io server
|
this.$socket.client.emit(`UpdateAnswer`, data);
|
||||||
console.log(data)
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
sockets: {
|
sockets: {
|
||||||
|
|
@ -147,8 +147,8 @@ export default {
|
||||||
* value: string
|
* value: string
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
this.answers[`team_${data.team}`][data.answer - 1] = data.value;
|
this.answers[`team_${data.team}`].splice(data.answer - 1, 1, data.value);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue