List add always at the end of all lists

- if a sort number is higher than the count of lists, the list wasn't
  added at the end
This commit is contained in:
Martin Filser 2021-11-15 17:31:42 +01:00
parent fa9641ba7b
commit 0fb6b6e519
2 changed files with 12 additions and 1 deletions

View file

@ -693,10 +693,19 @@ Boards.helpers({
{ sort: sortKey },
);
},
draggableLists() {
return Lists.find({ boardId: this._id }, { sort: { sort: 1 } });
},
/** returns the last list
* @returns Document the last list
*/
getLastList() {
const ret = Lists.findOne({ boardId: this._id }, { sort: { sort: 'desc' } });
return ret;
},
nullSortLists() {
return Lists.find({
boardId: this._id,