From be42b8d4cbdfa547ca019ab2dc9a590a115cc0e2 Mon Sep 17 00:00:00 2001 From: Chuck McAndrew Date: Tue, 9 Oct 2018 15:05:57 +0000 Subject: [PATCH 1/3] Add route to get cards by swimlaneid --- models/cards.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/models/cards.js b/models/cards.js index 66bfbcf38..974385d6e 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) { From d4774d398e20b50afb40112426f1ab7a997a81d6 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Wed, 10 Oct 2018 00:40:42 +0300 Subject: [PATCH 2/3] - Fix lint error: tab to spaces. Thanks to xet7 ! --- models/cards.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/cards.js b/models/cards.js index 974385d6e..25692c251 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, }; }), }); From 1db6efa9c875662bdcdac09bca94067ac88a21b7 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Wed, 10 Oct 2018 00:46:18 +0300 Subject: [PATCH 3/3] - [REST API: Get cards by swimlane id](https://github.com/wekan/wekan/pull/1944). Please [add docs](https://github.com/wekan/wekan/wiki/REST-API-Swimlanes). Thanks to dcmcand ! Closes #1934 --- CHANGELOG.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b20c311fc..6a546e79d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,10 @@ This release adds the following new features: -- [LDAP](https://github.com/wekan/wekan/commit/288800eafc91d07f859c4f59588e0b646137ccb9). In progress. +- [LDAP](https://github.com/wekan/wekan/commit/288800eafc91d07f859c4f59588e0b646137ccb9). Please test and [add info about bugs](https://github.com/wekan/wekan/issues/119); -- [Add LDAP support and authentications dropdown menu on login page](https://github.com/wekan/wekan/pull/1943). +- [Add LDAP support and authentications dropdown menu on login page](https://github.com/wekan/wekan/pull/1943); +- [REST API: Get cards by swimlane id](https://github.com/wekan/wekan/pull/1944). Please [add docs](https://github.com/wekan/wekan/wiki/REST-API-Swimlanes). and fixes the following bugs: @@ -13,7 +14,7 @@ and fixes the following bugs: - [Add info about root-url to GitHub issue template](https://github.com/wekan/wekan/commit/4c0eb7dcc19ca9ae8c5d2d0276e0d024269de236); - [Feature rules: fixes and enhancements](https://github.com/wekan/wekan/pull/1936). -Thanks to GitHub users Akuket, Angtrim, lberk, maximest-pierre, InfoSec812, schulz and xet7 for their contributions. +Thanks to GitHub users Akuket, Angtrim, dcmcand, lberk, maximest-pierre, InfoSec812, schulz and xet7 for their contributions. # v1.52.1 2018-10-02 Wekan Edge release