From e872eeea919df1e4f61e4fc3a71f57faa0560867 Mon Sep 17 00:00:00 2001 From: legonzaur Date: Mon, 30 Dec 2024 12:04:53 +0100 Subject: [PATCH] feat : send only user ids --- dto/gameresponse.dto.ts | 5 +++-- dto/playerresponse.dto.ts | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dto/gameresponse.dto.ts b/dto/gameresponse.dto.ts index ff92aee..38748e3 100644 --- a/dto/gameresponse.dto.ts +++ b/dto/gameresponse.dto.ts @@ -6,7 +6,8 @@ export class GameResponseDTO { constructor(partial: Partial) { this.id = partial.id; this.started = partial.started; - this.owner = new UserResponseDTO(partial.owner); + this.ownerId = partial.ownerId; + // this.owner = new UserResponseDTO(partial.owner); if (partial.players) { this.players = partial.players.map((p) => new PlayerResponseDTO(p)); } @@ -24,7 +25,7 @@ export class GameResponseDTO { id: number; - owner: UserResponseDTO; + ownerId: number; players: PlayerResponseDTO[] = []; diff --git a/dto/playerresponse.dto.ts b/dto/playerresponse.dto.ts index fdebc6b..b2d4110 100644 --- a/dto/playerresponse.dto.ts +++ b/dto/playerresponse.dto.ts @@ -3,10 +3,13 @@ import { UserResponseDTO } from './userresponse.dto'; export class PlayerResponseDTO { constructor(partial: Partial) { this.score = partial.score; - this.user = new UserResponseDTO(partial.user); + this.userId = partial.userId; + this.id = partial.id; + // this.user = new UserResponseDTO(partial.user); } - user: UserResponseDTO; + id: number; + userId: number; score: number; }