2
0
Эх сурвалжийг харах

Merge branch 'dcmcand-dcmcand-dev' into edge

Lauri Ojansivu 6 жил өмнө
parent
commit
1dda8bff5e
2 өөрчлөгдсөн 27 нэмэгдсэн , 3 устгасан
  1. 4 3
      CHANGELOG.md
  2. 23 0
      models/cards.js

+ 4 - 3
CHANGELOG.md

@@ -2,9 +2,10 @@
 
 
 This release adds the following new features:
 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);
   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:
 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);
 - [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).
 - [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
 # v1.52.1 2018-10-02 Wekan Edge release
 
 

+ 23 - 0
models/cards.js

@@ -1304,6 +1304,29 @@ if (Meteor.isServer) {
     cardRemover(userId, doc);
     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
 //LISTS REST API
 if (Meteor.isServer) {
 if (Meteor.isServer) {
   JsonRoutes.add('GET', '/api/boards/:boardId/lists/:listId/cards', function(req, res) {
   JsonRoutes.add('GET', '/api/boards/:boardId/lists/:listId/cards', function(req, res) {