diff --git a/srcs/requirements/nestjs/api_back/src/game/game.controller.ts b/srcs/requirements/nestjs/api_back/src/game/game.controller.ts index bd7636e3..04e04e86 100644 --- a/srcs/requirements/nestjs/api_back/src/game/game.controller.ts +++ b/srcs/requirements/nestjs/api_back/src/game/game.controller.ts @@ -26,8 +26,9 @@ export class GameController { @UseGuards(TwoFactorGuard) async getMatchHistory(@Req() req, @Query('username') username: string, @Res() res) { - console.log("DANS MATCH HISTORY") - console.log("usrrnmae" + username) + if (!username) { + username = req.user.username; + } return this.gameService.getMatchHistory(username, res); } diff --git a/srcs/requirements/nestjs/api_back/src/game/game.service.ts b/srcs/requirements/nestjs/api_back/src/game/game.service.ts index 0ef558a1..d90501cb 100644 --- a/srcs/requirements/nestjs/api_back/src/game/game.service.ts +++ b/srcs/requirements/nestjs/api_back/src/game/game.service.ts @@ -62,12 +62,9 @@ export class GameService { .where('history.playerOne.id = :userOne', {userOne : user.id}) .orWhere('history.playerTwo.id = :userTwo', {userTwo: user.id}) .getMany() - console.log("gZZZZZZZZZZZZamehistory") - console.log(...gameHistory) let sendableHistory : SendableMatchHistory[] = [] for (const history of gameHistory) { - console.log(history.playerOne.username + 'ssssssssss') sendableHistory.push(new SendableMatchHistory(history)) } console.log("sendable history") diff --git a/srcs/requirements/nestjs/api_back/src/users/class/matchHistory.class.ts b/srcs/requirements/nestjs/api_back/src/users/class/matchHistory.class.ts index 90cafc65..0313543f 100644 --- a/srcs/requirements/nestjs/api_back/src/users/class/matchHistory.class.ts +++ b/srcs/requirements/nestjs/api_back/src/users/class/matchHistory.class.ts @@ -16,6 +16,6 @@ export class SendableMatchHistory { this.playerOneUsername = matchHistory.playerOne.username; this.playerTwoUsername = matchHistory.playerTwo.username; this.playerOneResult = matchHistory.playerOneResult; - this.playerTwoResult = matchHistory.playerTwoResult; + this.playerTwoResult = matchHistory.playerTwoResult; }; } \ No newline at end of file diff --git a/srcs/requirements/svelte/api_front/src/pages/game/Game.svelte b/srcs/requirements/svelte/api_front/src/pages/game/Game.svelte index 97eac451..169d4f6b 100644 --- a/srcs/requirements/svelte/api_front/src/pages/game/Game.svelte +++ b/srcs/requirements/svelte/api_front/src/pages/game/Game.svelte @@ -305,11 +305,11 @@ {#if gameState.matchStarted && !gameState.matchEnded}
no match ongoing
{/if} @@ -263,12 +264,16 @@ canvas { font-size: 1vw; padding: 10px; } -#match_list { - font-family: 'Courier New', Courier, monospace; - font-size: 1vw; -} +/* #match_list { + text-align: center; +} */ .avatar { height: 5vw; width: 5vw; + margin-top: 2vw; + margin-bottom: -2vw; +} +button.margin_top { + margin-top: 1vw; } diff --git a/srcs/requirements/svelte/api_front/src/pages/profile/ProfileDisplay.svelte b/srcs/requirements/svelte/api_front/src/pages/profile/ProfileDisplay.svelte index d73a8a65..b0abc5a2 100644 --- a/srcs/requirements/svelte/api_front/src/pages/profile/ProfileDisplay.svelte +++ b/srcs/requirements/svelte/api_front/src/pages/profile/ProfileDisplay.svelte @@ -38,7 +38,13 @@ } #setting_button { - margin-top: 25px; + margin-top: 1vw; + font-family: "PressStart2P"; + background-color: #618174; + border-color: #071013; + color: white; + border-width: 2px; + font-size: 1vw; } diff --git a/srcs/requirements/svelte/api_front/src/pieces/GenerateUserDisplay.svelte b/srcs/requirements/svelte/api_front/src/pieces/GenerateUserDisplay.svelte index 621a21a9..499ef7e0 100644 --- a/srcs/requirements/svelte/api_front/src/pieces/GenerateUserDisplay.svelte +++ b/srcs/requirements/svelte/api_front/src/pieces/GenerateUserDisplay.svelte @@ -90,18 +90,23 @@ div.outer{ max-width: 960px; margin: 40px auto; + margin-top: 1vw; } /* The main part */ main{ max-width: 960px; margin: 40px auto; + margin-top: 1vw; text-align: center; } .avatar{ width: 15vw; height: 15vw; + max-width: 130px; + max-height: 130px; + margin-bottom: 1vw; } /* The variable rich section */ diff --git a/srcs/requirements/svelte/api_front/src/pieces/MatchHistory.svelte b/srcs/requirements/svelte/api_front/src/pieces/MatchHistory.svelte index e157c0da..3c165cd2 100644 --- a/srcs/requirements/svelte/api_front/src/pieces/MatchHistory.svelte +++ b/srcs/requirements/svelte/api_front/src/pieces/MatchHistory.svelte @@ -5,9 +5,9 @@ import type { MatchHistory } from "./Match"; export let user; - let matchList = []; + let matchList: MatchHistory[] = []; + onMount( async() => { - console.log(user.username + 'jjjjjjjjjjjjj') matchList = await fetchMatchList(user.username); console.log(matchList); // matchList = await mockMatchList(user.username); @@ -16,7 +16,6 @@ async function fetchMatchList(username: string) { 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) { @@ -96,7 +95,7 @@