0
0
Fork 0

Get questions from server.

This commit is contained in:
Oliver-Akins 2021-01-03 15:55:35 -07:00
parent 29514da442
commit 1eac963bc5

View file

@ -25,13 +25,18 @@ export default {
methods: { methods: {
requestQuestions() { requestQuestions() {
console.debug(`Requesting questions for team ${this.$store.state.team}`); console.debug(`Requesting questions for team ${this.$store.state.team}`);
// TODO -> Emit event to server this.$socket.client.emit(`GetPastQuestions`, {
game_code: this.$store.state.game_code,
team: this.$store.state.team
});
}, },
}, },
sockets: { sockets: {
PastQuestions(data) { PastQuestions(data) {
console.debug(`Received question data from the server.`); if (data.status < 200 || 300 <= data.status) {
this.questions = data; this.$emit(`error`, data);
};
this.questions = data.questions;
}, },
}, },
mounted() { mounted() {