1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 13:19:44 +02:00

fix: Allow to use endpoints via http

This commit is contained in:
Maksim Eltyshev 2022-06-24 11:59:04 +02:00
parent c1ef9541ba
commit d5076cf722
2 changed files with 6 additions and 12 deletions

View file

@ -33,11 +33,6 @@ module.exports = {
}, },
async fn(inputs) { async fn(inputs) {
// TODO: allow over HTTP without subscription
if (!this.req.isSocket) {
return this.res.badRequest();
}
const { currentUser } = this.req; const { currentUser } = this.req;
const project = await Project.findOne(inputs.projectId); const project = await Project.findOne(inputs.projectId);
@ -61,7 +56,9 @@ module.exports = {
this.req, 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 { return {
item: board, item: board,

View file

@ -20,11 +20,6 @@ module.exports = {
}, },
async fn(inputs) { async fn(inputs) {
// TODO: allow over HTTP without subscription
if (!this.req.isSocket) {
return this.res.badRequest();
}
const { currentUser } = this.req; const { currentUser } = this.req;
const { board, project } = await sails.helpers.boards 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 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 { return {
item: board, item: board,