summaryrefslogtreecommitdiffstats
path: root/models/cards.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-10-10 00:36:42 +0300
committerLauri Ojansivu <x@xet7.org>2018-10-10 00:36:42 +0300
commit04f5bda70a9cba0b2e57ae514523e89fa5a97594 (patch)
tree3b40f6964da1ea997d7c3933d259da00edb57c8f /models/cards.js
parentf11c8727d9cb013d05f3674c807cc8c353a2bbd8 (diff)
parentbe42b8d4cbdfa547ca019ab2dc9a590a115cc0e2 (diff)
downloadwekan-04f5bda70a9cba0b2e57ae514523e89fa5a97594.tar.gz
wekan-04f5bda70a9cba0b2e57ae514523e89fa5a97594.tar.bz2
wekan-04f5bda70a9cba0b2e57ae514523e89fa5a97594.zip
Merge branch 'dcmcand-dev' of https://github.com/dcmcand/wekan into dcmcand-dcmcand-dev
Diffstat (limited to 'models/cards.js')
-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) {