add natural sort for notes, introduce new label #sortNatural

This commit is contained in:
Nriver
2023-03-10 14:35:36 +08:00
parent 6b4800d2d6
commit d3ec9f022c
5 changed files with 31 additions and 10 deletions

View File

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