From 1eac963bc5640ee96b5a6a6c88205c2266a16651 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Sun, 3 Jan 2021 15:55:35 -0700 Subject: [PATCH] Get questions from server. --- web/src/components/PastQuestions.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/web/src/components/PastQuestions.vue b/web/src/components/PastQuestions.vue index 559c58c..d6afd12 100644 --- a/web/src/components/PastQuestions.vue +++ b/web/src/components/PastQuestions.vue @@ -25,13 +25,18 @@ export default { methods: { requestQuestions() { 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: { PastQuestions(data) { - console.debug(`Received question data from the server.`); - this.questions = data; + if (data.status < 200 || 300 <= data.status) { + this.$emit(`error`, data); + }; + this.questions = data.questions; }, }, mounted() {