fix : assign event type in class
This commit is contained in:
+7
-5
@@ -2,20 +2,22 @@ import { GameResponseDTO } from './dto/gameresponse.dto';
|
|||||||
import { PlayerResponseDTO } from './dto/playerresponse.dto';
|
import { PlayerResponseDTO } from './dto/playerresponse.dto';
|
||||||
|
|
||||||
export class GameCreateEvent extends GameResponseDTO {
|
export class GameCreateEvent extends GameResponseDTO {
|
||||||
type: 'create';
|
type = 'create';
|
||||||
}
|
}
|
||||||
|
|
||||||
export class GameDeleteEvent {
|
export class GameDeleteEvent {
|
||||||
type: 'delete';
|
type = 'delete';
|
||||||
constructor(public id?: number) {}
|
constructor(public id?: number) { }
|
||||||
}
|
}
|
||||||
export class GameJoinEvent {
|
export class GameJoinEvent {
|
||||||
type: 'joingame';
|
type = 'joingame';
|
||||||
gameId: number;
|
gameId: number;
|
||||||
constructor(
|
constructor(
|
||||||
public player: PlayerResponseDTO,
|
public player: PlayerResponseDTO,
|
||||||
game?: Partial<GameResponseDTO>,
|
game?: Partial<GameResponseDTO>,
|
||||||
) {
|
) {
|
||||||
this.gameId = game.id;
|
if (game && game.id) {
|
||||||
|
this.gameId = game.id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-10
@@ -1,26 +1,26 @@
|
|||||||
import { WordResponseDTO } from './dto/wordresponse.dto';
|
import { WordResponseDTO } from './dto/wordresponse.dto';
|
||||||
|
|
||||||
export class WordCreateEvent {
|
export class WordCreateEvent {
|
||||||
type: 'create';
|
type = 'create';
|
||||||
constructor(public word: WordResponseDTO) {}
|
constructor(public word: WordResponseDTO) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
export class WordEditEvent {
|
export class WordEditEvent {
|
||||||
type: 'edit';
|
type = 'edit';
|
||||||
constructor(public word: WordResponseDTO) {}
|
constructor(public word: WordResponseDTO) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
export class WordDeleteEvent {
|
export class WordDeleteEvent {
|
||||||
type: 'delete';
|
type = 'delete';
|
||||||
constructor(public id: number) {}
|
constructor(public id: number) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
export class WordEnableEvent {
|
export class WordEnableEvent {
|
||||||
type: 'enable';
|
type = 'enable';
|
||||||
constructor(public id: number) {}
|
constructor(public id: number) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
export class WordDisableEvent {
|
export class WordDisableEvent {
|
||||||
type: 'disable';
|
type = 'disable';
|
||||||
constructor(public id: number) {}
|
constructor(public id: number) { }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user