correction de petites erreurs

This commit is contained in:
batche
2022-11-21 12:08:36 +01:00
parent f1df3964f9
commit b8d404ce13
8 changed files with 48 additions and 24 deletions

View File

@@ -3,12 +3,16 @@
import { onMount } from "svelte";
let user = {};
let stats = {};
onMount (async() => {
console.log("PROFIL SVELTE");
const {data} = await axios.get('http://transcendance:8080/api/v2/user');
console.log(data.username);
console.log(data);
user = data;
const response = await fetch('http://transcendance:8080/api/v2/user',
{
method : 'GET',
}).then(response => response.json());
console.log(response);
user = response;
stats = user.stats;
});
</script>
@@ -21,6 +25,11 @@
<h1>Profil</h1>
<ul>
<li>username : {user.username}</li>
<li>stats : Win games {stats.winGame}
Lose games {stats.loseGame}
Draw games {stats.drawGame}
Total games {stats.totalGame}
</li>
</ul>
</div>
</div>