Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve API listDocsByPath param sort #8156

Merged
merged 6 commits into from May 2, 2023
Merged

Conversation

OpaqueGlass
Copy link
Contributor

  • Please commit to the dev branch
  • For contributing new features, please supplement and improve the corresponding user guide documents
  • For bug fixes, please describe the problem and solution via code comments
  • For text improvements (such as typos and wording adjustments), please submit directly

使用场景
在挂件/插件中,经常使用这个api获取子文档。如果能不受限制地通过sort指定排序方式(大概)会更好。

但在笔记本排序方式不是“使用文档树排序规则”时,该api的sort参数被忽略、以笔记本排序为准。(相关代码行

似乎在所有调用ListDocTree(或使用listDocsByPath)的位置sort都是文档树排序号。因此尝试修改为:

  1. 对不指定sort参数或sort排序类型为16的情况,按照 原来的方法确定排序方式;
  2. 对指定sort参数的情况,以传入的参数为准;

此PR包含的其他更改

  1. 对调用ListDocTree函数的,sort参数由 model.Conf.FileTree.Sort 修改为util.SortModeUnassigned
  2. 前端不再传入sort参数;

kernel/util/sort.go Outdated Show resolved Hide resolved
@88250 88250 changed the title Improving listDocsByPath API sort Param Improve API listDocsByPath param sort May 2, 2023
@88250 88250 added this to the 2.8.7 milestone May 2, 2023
@88250 88250 merged commit 6b62a69 into siyuan-note:dev May 2, 2023
@88250
Copy link
Member

88250 commented May 2, 2023

感谢贡献,饮水思源!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants