diff --git a/server/api/controllers/boards/create.js b/server/api/controllers/boards/create.js index 7aaada4a..49d04346 100755 --- a/server/api/controllers/boards/create.js +++ b/server/api/controllers/boards/create.js @@ -33,11 +33,6 @@ module.exports = { }, async fn(inputs) { - // TODO: allow over HTTP without subscription - if (!this.req.isSocket) { - return this.res.badRequest(); - } - const { currentUser } = this.req; const project = await Project.findOne(inputs.projectId); @@ -61,7 +56,9 @@ module.exports = { this.req, ); - sails.sockets.join(this.req, `board:${board.id}`); // TODO: only when subscription needed + if (this.req.isSocket) { + sails.sockets.join(this.req, `board:${board.id}`); // TODO: only when subscription needed + } return { item: board, diff --git a/server/api/controllers/boards/show.js b/server/api/controllers/boards/show.js index 8fbb017f..ac7fadc8 100755 --- a/server/api/controllers/boards/show.js +++ b/server/api/controllers/boards/show.js @@ -20,11 +20,6 @@ module.exports = { }, async fn(inputs) { - // TODO: allow over HTTP without subscription - if (!this.req.isSocket) { - return this.res.badRequest(); - } - const { currentUser } = this.req; const { board, project } = await sails.helpers.boards @@ -77,7 +72,9 @@ module.exports = { card.isSubscribed = isSubscribedByCardId[card.id] || false; // eslint-disable-line no-param-reassign }); - sails.sockets.join(this.req, `board:${board.id}`); // TODO: only when subscription needed + if (this.req.isSocket) { + sails.sockets.join(this.req, `board:${board.id}`); // TODO: only when subscription needed + } return { item: board,