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 {
Packet: Join,
validator: async () => {
if (!validateChannel()) {
validator: async ({data: {channel}}) => {
if (!validateChannel(channel)) {
throw new ValidationError({code: 400, reason: 'Malformed channel'});
}
},
responder: async ({data: channel}, socket) => {
responder: async ({data: {channel}}, socket) => {
const {req} = socket;
await userJoin(channel, socket.socket);
return channelState(req, channel);