mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 10:00:13 +01:00
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:
parent
cb527d7765
commit
6b62a69299
8 changed files with 21 additions and 22 deletions
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue