chore : remove class-transformer
This commit is contained in:
+6
-15
@@ -1,4 +1,3 @@
|
||||
import { Expose, Type } from 'class-transformer';
|
||||
import { UserResponseDTO } from './userresponse.dto';
|
||||
import { PlayerResponseDTO } from './playerresponse.dto';
|
||||
import { ConceptInTurnResponseDTO } from './conceptinturnresponse.dto';
|
||||
@@ -6,31 +5,23 @@ import { ConceptInTurnResponseDTO } from './conceptinturnresponse.dto';
|
||||
export class GameResponseDTO {
|
||||
constructor(partial: Partial<GameResponseDTO>) {
|
||||
Object.assign(this, partial);
|
||||
this.owner = partial.owner;
|
||||
this.players = partial.players;
|
||||
this.currentPlayer = partial.currentPlayer;
|
||||
this.currentConcepts = partial.currentConcepts;
|
||||
this.owner = new UserResponseDTO(partial.owner);
|
||||
this.players = partial.players.map((p) => new PlayerResponseDTO(p));
|
||||
this.currentPlayer = new PlayerResponseDTO(partial.currentPlayer);
|
||||
this.currentConcepts = partial.currentConcepts.map(
|
||||
(c) => new ConceptInTurnResponseDTO(c),
|
||||
);
|
||||
}
|
||||
|
||||
@Expose()
|
||||
id: number;
|
||||
|
||||
@Type(() => UserResponseDTO)
|
||||
@Expose()
|
||||
owner: UserResponseDTO;
|
||||
|
||||
@Type(() => PlayerResponseDTO)
|
||||
@Expose()
|
||||
players: PlayerResponseDTO[];
|
||||
|
||||
@Type(() => PlayerResponseDTO)
|
||||
@Expose()
|
||||
currentPlayer: PlayerResponseDTO;
|
||||
|
||||
@Expose()
|
||||
started: boolean;
|
||||
|
||||
@Type(() => ConceptInTurnResponseDTO)
|
||||
@Expose()
|
||||
currentConcepts: ConceptInTurnResponseDTO[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user