mirror of
https://github.com/plankanban/planka.git
synced 2025-12-18 17:23:21 +03:00
fix: Allow to use endpoints via http
This commit is contained in:
@@ -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,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (this.req.isSocket) {
|
||||||
sails.sockets.join(this.req, `board:${board.id}`); // TODO: only when subscription needed
|
sails.sockets.join(this.req, `board:${board.id}`); // TODO: only when subscription needed
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
item: board,
|
item: board,
|
||||||
|
|||||||
@@ -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
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (this.req.isSocket) {
|
||||||
sails.sockets.join(this.req, `board:${board.id}`); // TODO: only when subscription needed
|
sails.sockets.join(this.req, `board:${board.id}`); // TODO: only when subscription needed
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
item: board,
|
item: board,
|
||||||
|
|||||||
Reference in New Issue
Block a user