mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Added /api/user/boards
This commit is contained in:
parent
e285632d9e
commit
0cf0f20f9d
1 changed files with 12 additions and 0 deletions
|
|
@ -556,6 +556,18 @@ if (Meteor.isServer) {
|
||||||
|
|
||||||
//BOARDS REST API
|
//BOARDS REST API
|
||||||
if (Meteor.isServer) {
|
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) {
|
JsonRoutes.add('GET', '/api/boards', function (req, res, next) {
|
||||||
Authentication.checkUserId(req.userId);
|
Authentication.checkUserId(req.userId);
|
||||||
JsonRoutes.sendResult(res, {
|
JsonRoutes.sendResult(res, {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue