From be42b8d4cbdfa547ca019ab2dc9a590a115cc0e2 Mon Sep 17 00:00:00 2001 From: Chuck McAndrew Date: Tue, 9 Oct 2018 15:05:57 +0000 Subject: Add route to get cards by swimlaneid --- models/cards.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'models/cards.js') diff --git a/models/cards.js b/models/cards.js index 66bfbcf3..974385d6 100644 --- a/models/cards.js +++ b/models/cards.js @@ -1304,6 +1304,29 @@ if (Meteor.isServer) { cardRemover(userId, doc); }); } +//SWIMLANES REST API +if (Meteor.isServer) { + JsonRoutes.add('GET', '/api/boards/:boardId/swimlanes/:swimlaneId/cards', function(req, res) { + const paramBoardId = req.params.boardId; + const paramSwimlaneId = req.params.swimlaneId; + Authentication.checkBoardAccess(req.userId, paramBoardId); + JsonRoutes.sendResult(res, { + code: 200, + data: Cards.find({ + boardId: paramBoardId, + swimlaneId: paramSwimlaneId, + archived: false, + }).map(function(doc) { + return { + _id: doc._id, + title: doc.title, + description: doc.description, + listId: doc.listId, + }; + }), + }); + }); +} //LISTS REST API if (Meteor.isServer) { JsonRoutes.add('GET', '/api/boards/:boardId/lists/:listId/cards', function(req, res) { -- cgit v1.2.3-1-g7c22 From d4774d398e20b50afb40112426f1ab7a997a81d6 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Wed, 10 Oct 2018 00:40:42 +0300 Subject: - Fix lint error: tab to spaces. Thanks to xet7 ! --- models/cards.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'models/cards.js') diff --git a/models/cards.js b/models/cards.js index 974385d6..25692c25 100644 --- a/models/cards.js +++ b/models/cards.js @@ -1321,7 +1321,7 @@ if (Meteor.isServer) { _id: doc._id, title: doc.title, description: doc.description, - listId: doc.listId, + listId: doc.listId, }; }), }); -- cgit v1.2.3-1-g7c22