add the ability to sort notes by folders first, closes #2649

This commit is contained in:
zadam
2022-05-30 20:50:53 +02:00
parent dcf31f8f95
commit f19adf3ee0
4 changed files with 16 additions and 6 deletions

View File

@@ -94,13 +94,13 @@ function undeleteNote(req) {
function sortChildNotes(req) {
const noteId = req.params.noteId;
const {sortBy, sortDirection} = req.body;
const {sortBy, sortDirection, foldersFirst} = req.body;
log.info(`Sorting '${noteId}' children with ${sortBy} ${sortDirection}`);
log.info(`Sorting '${noteId}' children with ${sortBy} ${sortDirection}, foldersFirst=${foldersFirst}`);
const reverse = sortDirection === 'desc';
treeService.sortNotes(noteId, sortBy, reverse);
treeService.sortNotes(noteId, sortBy, reverse, foldersFirst);
}
function protectNote(req) {