Added /api/user/boards

This commit is contained in:
Johannes May 2017-05-13 22:56:26 +02:00
parent e285632d9e
commit 0cf0f20f9d

View file

@ -556,6 +556,18 @@ if (Meteor.isServer) {
//BOARDS REST API
if (Meteor.isServer) {
JsonRoutes.add('GET', '/api/user/boards', function (req, res, next) {
// TODO: This should be changed to be less restrictive!
Authentication.checkUserId(req.userId);
return Boards.find({
archived: false,
'members.userId': req.userId, // TODO: How does the current authentication system work? Can we rely on req.userId to be correct?
}, {
sort: ['title'],
});
});
JsonRoutes.add('GET', '/api/boards', function (req, res, next) {
Authentication.checkUserId(req.userId);
JsonRoutes.sendResult(res, {