1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-18 20:59:44 +02:00
planka/server/api/controllers/users/show.js

17 lines
377 B
JavaScript
Raw Normal View History

2019-08-31 04:07:25 +05:00
module.exports = {
async fn(inputs, exits) {
2019-08-31 04:07:25 +05:00
// TODO: allow over HTTP without subscription
if (!this.req.isSocket) {
return this.res.badRequest();
}
const { currentUser } = this.req;
sails.sockets.join(this.req, `user:${currentUser.id}`); // TODO: only when subscription needed
return exits.success({
item: currentUser,
2019-08-31 04:07:25 +05:00
});
},
2019-08-31 04:07:25 +05:00
};