fix: join destructure

This commit is contained in:
cha0s 2020-07-24 07:49:00 -05:00
parent a4e30c0424
commit 2d2afe21b6

View File

@ -24,12 +24,12 @@ export const userJoin = async (channel, socket) => {
export default { export default {
Packet: Join, Packet: Join,
validator: async () => { validator: async ({data: {channel}}) => {
if (!validateChannel()) { if (!validateChannel(channel)) {
throw new ValidationError({code: 400, reason: 'Malformed channel'}); throw new ValidationError({code: 400, reason: 'Malformed channel'});
} }
}, },
responder: async ({data: channel}, socket) => { responder: async ({data: {channel}}, socket) => {
const {req} = socket; const {req} = socket;
await userJoin(channel, socket.socket); await userJoin(channel, socket.socket);
return channelState(req, channel); return channelState(req, channel);