Add ResetGame types
This commit is contained in:
parent
aa5159d10f
commit
3441e5acd2
2 changed files with 6 additions and 1 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
import { games, log } from '../main';
|
import { games, log } from '../main';
|
||||||
import { Server, Socket } from 'socket.io';
|
import { Server, Socket } from 'socket.io';
|
||||||
|
|
||||||
export default (io: Server, socket: Socket, data: any) => {
|
export default (io: Server, socket: Socket, data: ResetGame) => {
|
||||||
try {
|
try {
|
||||||
if (!games[data.game_code]) {
|
if (!games[data.game_code]) {
|
||||||
log.debug(`Can't find game with code: ${data.game_code}`);
|
log.debug(`Can't find game with code: ${data.game_code}`);
|
||||||
|
|
|
||||||
5
server/src/types/data.d.ts
vendored
5
server/src/types/data.d.ts
vendored
|
|
@ -45,6 +45,11 @@ interface StartGame {
|
||||||
}
|
}
|
||||||
interface GameStarted extends response {}
|
interface GameStarted extends response {}
|
||||||
|
|
||||||
|
interface ResetGame {
|
||||||
|
game_code: string;
|
||||||
|
}
|
||||||
|
interface GameReset extends response {}
|
||||||
|
|
||||||
|
|
||||||
interface GetPastQuestions {
|
interface GetPastQuestions {
|
||||||
game_code: string;
|
game_code: string;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue