Improve API listDocsByPath param sort (#8156)

* `listDocsByPath` API `sort` param
backend

* `listDocsByPath` API `sort` param
frontend

* `listDocsByPath` API `sort` param
This commit is contained in:
OpaqueGlass 2023-05-02 23:22:40 +08:00 committed by GitHub
parent cb527d7765
commit 6b62a69299
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 21 additions and 22 deletions

View file

@ -588,7 +588,6 @@ export class Files extends Model {
fetchPost("/api/filetree/listDocsByPath", {
notebook: toURL,
path: toDir === "/" ? "/" : toDir + ".sy",
sort: window.siyuan.config.fileTree.sort,
}, response => {
if (response.data.path === "/" && response.data.files.length === 0) {
showMessage(window.siyuan.languages.emptyContent);
@ -883,8 +882,7 @@ export class Files extends Model {
} else if (filePath.startsWith(item.path.replace(".sy", ""))) {
fetchPost("/api/filetree/listDocsByPath", {
notebook: data.box,
path: item.path,
sort: window.siyuan.config.fileTree.sort
path: item.path
}, response => {
this.selectItem(response.data.box, filePath, response.data);
});
@ -926,7 +924,6 @@ export class Files extends Model {
fetchPost("/api/filetree/listDocsByPath", {
notebook: notebookId,
path: liElement.getAttribute("data-path"),
sort: window.siyuan.config.fileTree.sort,
}, response => {
if (response.data.path === "/" && response.data.files.length === 0) {
showMessage(window.siyuan.languages.emptyContent);
@ -966,8 +963,7 @@ export class Files extends Model {
} else {
fetchPost("/api/filetree/listDocsByPath", {
notebook: notebookId,
path: currentPath,
sort: window.siyuan.config.fileTree.sort
path: currentPath
}, response => {
this.onLsSelect(response.data, filePath);
});