fix : assign event type in class
This commit is contained in:
+5
-3
@@ -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
@@ -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) { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user