Feat : add messages
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
import { UserResponseDTO } from './userresponse.dto';
|
||||
import { PlayerResponseDTO } from './playerresponse.dto';
|
||||
import { ConceptInTurnResponseDTO } from './conceptinturnresponse.dto';
|
||||
import { MessageResponseDTO } from './messageresponse.dto';
|
||||
|
||||
export class GameResponseDTO {
|
||||
constructor(partial: Partial<GameResponseDTO>) {
|
||||
this.id = partial.id;
|
||||
this.started = partial.started;
|
||||
this.ownerId = partial.ownerId;
|
||||
// this.owner = new UserResponseDTO(partial.owner);
|
||||
if (partial.messages) {
|
||||
this.messages = partial.messages.map((m) => new MessageResponseDTO(m));
|
||||
}
|
||||
if (partial.players) {
|
||||
this.players = partial.players.map((p) => new PlayerResponseDTO(p));
|
||||
}
|
||||
@@ -25,7 +28,7 @@ export class GameResponseDTO {
|
||||
|
||||
id: number;
|
||||
|
||||
ownerId: number;
|
||||
ownerId: string;
|
||||
|
||||
players: PlayerResponseDTO[] = [];
|
||||
|
||||
@@ -34,4 +37,6 @@ export class GameResponseDTO {
|
||||
started: boolean;
|
||||
|
||||
currentConcepts: ConceptInTurnResponseDTO[] = [];
|
||||
|
||||
messages: MessageResponseDTO[] = [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user