diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2019-01-25 10:57:46 +0100 |
---|---|---|
committer | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2019-01-25 11:04:56 +0100 |
commit | b5411841cf6aa33b2c0d29d85cbc795e3faa7f4f (patch) | |
tree | e4f9da788c14451f01bbbb0cc6dc10dd68d9f897 /models/lists.js | |
parent | 5c6a725712a443b4d03b4f86262033ddfb66bc3d (diff) | |
download | wekan-b5411841cf6aa33b2c0d29d85cbc795e3faa7f4f.tar.gz wekan-b5411841cf6aa33b2c0d29d85cbc795e3faa7f4f.tar.bz2 wekan-b5411841cf6aa33b2c0d29d85cbc795e3faa7f4f.zip |
api: fix the sort field when inserting a swimlane or a list
This has the side effect of always inserting the element at the end.
Diffstat (limited to 'models/lists.js')
-rw-r--r-- | models/lists.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/models/lists.js b/models/lists.js index 0e1ba801..39ff130a 100644 --- a/models/lists.js +++ b/models/lists.js @@ -314,9 +314,11 @@ if (Meteor.isServer) { try { Authentication.checkUserId( req.userId); const paramBoardId = req.params.boardId; + const board = Boards.findOne(paramBoardId); const id = Lists.insert({ title: req.body.title, boardId: paramBoardId, + sort: board.lists().count(), }); JsonRoutes.sendResult(res, { code: 200, |