summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorChuck McAndrew <chuck.mcandrew@leblibrary.com>2018-10-09 15:05:57 +0000
committerChuck McAndrew <chuck.mcandrew@leblibrary.com>2018-10-09 15:05:57 +0000
commitbe42b8d4cbdfa547ca019ab2dc9a590a115cc0e2 (patch)
tree7766af8748b2f47e34004365440b72a145b85570 /models
parent4c6c6ffb164027c5a5f29d213be9858c23efd3bf (diff)
downloadwekan-be42b8d4cbdfa547ca019ab2dc9a590a115cc0e2.tar.gz
wekan-be42b8d4cbdfa547ca019ab2dc9a590a115cc0e2.tar.bz2
wekan-be42b8d4cbdfa547ca019ab2dc9a590a115cc0e2.zip
Add route to get cards by swimlaneid
Diffstat (limited to 'models')
-rw-r--r--models/cards.js23
1 files changed, 23 insertions, 0 deletions
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) {