Add sortDefault helper for sorting boards

This commit is contained in:
boeserwolf 2020-04-19 12:30:21 +03:00
parent 9f396e9038
commit 10fcc19b7f
10 changed files with 50 additions and 31 deletions

View file

@ -36,6 +36,7 @@ Meteor.publish('boards', function() {
permission: 1,
type: 1,
},
sort: { sort: 1 /* boards default sorting */ },
},
);
});
@ -61,6 +62,7 @@ Meteor.publish('archivedBoards', function() {
slug: 1,
title: 1,
},
sort: { sort: 1 /* boards default sorting */ },
},
);
});
@ -90,7 +92,7 @@ Meteor.publishRelations('board', function(boardId, isArchived) {
$or,
// Sort required to ensure oplog usage
},
{ limit: 1, sort: { _id: 1 } },
{ limit: 1, sort: { sort: 1 /* boards default sorting */, _id: 1 } },
),
function(boardId, board) {
this.cursor(Lists.find({ boardId, archived: isArchived }));