Get questions from server.
This commit is contained in:
parent
29514da442
commit
1eac963bc5
1 changed files with 8 additions and 3 deletions
|
|
@ -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() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue