feat(ui): FRO-34 Lobby (#21)
Started with Lobby Component Co-authored-by: LQ63 <lkhermann@web.de> Co-authored-by: Janis <janis-e@gmx.de> Reviewed-on: #21 Reviewed-by: Janis <janis-e@gmx.de> Co-authored-by: lq64 <lq@blackhole.local> Co-committed-by: lq64 <lq@blackhole.local>
This commit is contained in:
@@ -2,6 +2,7 @@ import { defineStore } from 'pinia'
|
||||
import {ref, type Ref} from 'vue'
|
||||
import type {GameInfo, LobbyInfo, TieInfo, TrumpInfo, WonInfo} from "@/types/GameTypes.ts";
|
||||
import axios from "axios";
|
||||
import {initWebSocket} from "@/services/ws.ts";
|
||||
|
||||
const api = window?.__RUNTIME_CONFIG__?.API_URL;
|
||||
|
||||
@@ -14,8 +15,8 @@ export const useIngame = defineStore('ingame', () => {
|
||||
data.value = newData;
|
||||
}
|
||||
|
||||
function requestGame(gameId: string) {
|
||||
axios.get(`${api}/status/${gameId}`, {withCredentials: true}).then((response) => {
|
||||
async function requestGame(gameId: string) {
|
||||
await axios.get(`${api}/status/${gameId}`, {withCredentials: true}).then((response) => {
|
||||
setIngame(response.data.state, response.data.data);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user