correction de petites erreurs
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user