summaryrefslogtreecommitdiffstats
path: root/models/swimlanes.js
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-01-25 10:57:46 +0100
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-01-25 11:04:56 +0100
commitb5411841cf6aa33b2c0d29d85cbc795e3faa7f4f (patch)
treee4f9da788c14451f01bbbb0cc6dc10dd68d9f897 /models/swimlanes.js
parent5c6a725712a443b4d03b4f86262033ddfb66bc3d (diff)
downloadwekan-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/swimlanes.js')
-rw-r--r--models/swimlanes.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/models/swimlanes.js b/models/swimlanes.js
index 93057362..e2c3925c 100644
--- a/models/swimlanes.js
+++ b/models/swimlanes.js
@@ -256,9 +256,11 @@ if (Meteor.isServer) {
try {
Authentication.checkUserId( req.userId);
const paramBoardId = req.params.boardId;
+ const board = Boards.findOne(paramBoardId);
const id = Swimlanes.insert({
title: req.body.title,
boardId: paramBoardId,
+ sort: board.swimlanes().count(),
});
JsonRoutes.sendResult(res, {
code: 200,