1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-10-06 22:17:10 +02:00

Clipper: Fixes #1417: Sort the folders in the same order as the desktop app

This commit is contained in:
Laurent Cozic
2019-04-20 19:29:23 +01:00
parent c3262aa5f8
commit 4ef05272c4
3 changed files with 17 additions and 7 deletions

View File

@@ -14,6 +14,7 @@ const HtmlToMd = require('lib/HtmlToMd');
const { fileExtension, safeFileExtension, safeFilename, filename } = require('lib/path-utils');
const ApiResponse = require('lib/services/rest/ApiResponse');
const SearchEngineUtils = require('lib/services/SearchEngineUtils');
const { FoldersScreenUtils } = require('lib/folders-screen-utils.js');
class ApiError extends Error {
@@ -221,7 +222,9 @@ class Api {
async action_folders(request, id = null, link = null) {
if (request.method === 'GET' && !id) {
return await Folder.allAsTree({ fields: this.fields_(request, ['id', 'parent_id', 'title']) });
const folders = await FoldersScreenUtils.allForDisplay({ fields: this.fields_(request, ['id', 'parent_id', 'title']) });
const output = await Folder.allAsTree(folders);
return output;
}
if (request.method === 'GET' && id) {