eslint
This commit is contained in:
parent
a65b8a9067
commit
8564088a3b
2 changed files with 26 additions and 25 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { FastifyPluginAsync } from 'fastify';
|
||||
import { Static, Type } from 'typebox';
|
||||
import { broadcastNextGame} from '../broadcastNextGame';
|
||||
import { broadcastNextGame } from '../broadcastNextGame';
|
||||
|
||||
export const ChatReq = Type.Object({
|
||||
message: Type.String(),
|
||||
|
|
@ -28,22 +28,22 @@ export type ChatReq = Static<typeof ChatReq>;
|
|||
|
||||
const route: FastifyPluginAsync = async (fastify): Promise<void> => {
|
||||
fastify.post('/api/chat/broadcast', {
|
||||
schema: {
|
||||
body: {
|
||||
type: 'object',
|
||||
required: ['nextGame'],
|
||||
properties: {
|
||||
nextGame: { type: 'string' }
|
||||
}
|
||||
}
|
||||
}
|
||||
}, async (req, reply) => {
|
||||
const gameLink: Promise<string> = Promise.resolve(req.body as string );
|
||||
if (gameLink)
|
||||
schema: {
|
||||
body: {
|
||||
type: 'object',
|
||||
required: ['nextGame'],
|
||||
properties: {
|
||||
nextGame: { type: 'string' },
|
||||
},
|
||||
},
|
||||
},
|
||||
}, async (req, reply) => {
|
||||
const gameLink: Promise<string> = Promise.resolve(req.body as string);
|
||||
if (gameLink) {
|
||||
broadcastNextGame(fastify, gameLink);
|
||||
|
||||
return reply.send({ status: 'ok' });
|
||||
});
|
||||
}
|
||||
return reply.send({ status: 'ok' });
|
||||
});
|
||||
};
|
||||
export default route;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue