mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 21:17:18 -04:00
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.
This commit is contained in:
parent
5c6a725712
commit
b5411841cf
2 changed files with 4 additions and 0 deletions
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue