fix : assign event type in class

This commit is contained in:
2024-12-29 12:14:08 +01:00
parent 03d4a1ba26
commit f9623a7961
2 changed files with 17 additions and 15 deletions
+5 -3
View File
@@ -2,20 +2,22 @@ import { GameResponseDTO } from './dto/gameresponse.dto';
import { PlayerResponseDTO } from './dto/playerresponse.dto';
export class GameCreateEvent extends GameResponseDTO {
type: 'create';
type = 'create';
}
export class GameDeleteEvent {
type: 'delete';
type = 'delete';
constructor(public id?: number) { }
}
export class GameJoinEvent {
type: 'joingame';
type = 'joingame';
gameId: number;
constructor(
public player: PlayerResponseDTO,
game?: Partial<GameResponseDTO>,
) {
if (game && game.id) {
this.gameId = game.id;
}
}
}
+5 -5
View File
@@ -1,26 +1,26 @@
import { WordResponseDTO } from './dto/wordresponse.dto';
export class WordCreateEvent {
type: 'create';
type = 'create';
constructor(public word: WordResponseDTO) { }
}
export class WordEditEvent {
type: 'edit';
type = 'edit';
constructor(public word: WordResponseDTO) { }
}
export class WordDeleteEvent {
type: 'delete';
type = 'delete';
constructor(public id: number) { }
}
export class WordEnableEvent {
type: 'enable';
type = 'enable';
constructor(public id: number) { }
}
export class WordDisableEvent {
type: 'disable';
type = 'disable';
constructor(public id: number) { }
}