This commit is contained in:
cherif
2023-01-18 01:22:20 +01:00
parent 3fa0add679
commit d44576513e
4 changed files with 26 additions and 15 deletions

View File

@@ -5,9 +5,9 @@
import type { MatchHistory } from "./Match";
export let user;
let matchList: MatchHistory[] = [];
let matchList = [];
onMount( async() => {
console.log(user.username + 'jjjjjjjjjjjjj')
matchList = await fetchMatchList(user.username);
console.log(matchList);
// matchList = await mockMatchList(user.username);
@@ -15,8 +15,8 @@
async function fetchMatchList(username: string)
{
let url = `http://${process.env.WEBSITE_HOST}:${process.env.WEBSITE_PORT}/api/v2/game/match/history/${username}`;
let url = `http://${process.env.WEBSITE_HOST}:${process.env.WEBSITE_PORT}/api/v2/game/match/history?username=${username}`;
console.log(url + 'ffffffff')
return fetch(url)
.then((response) => {
if (!response.ok) {