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

Add a new api '/api/filetree/getPathByID' #12352

Closed
ytm157 opened this issue Aug 28, 2024 · 2 comments
Closed

Add a new api '/api/filetree/getPathByID' #12352

ytm157 opened this issue Aug 28, 2024 · 2 comments

Comments

@ytm157
Copy link
Contributor

ytm157 commented Aug 28, 2024

In what scenarios do you need this feature?

没有合适的接口可以直接根据 ID 删除 doc,看了下 siyuan 的源代码,发现前端是通过 listDocsByPath 接口取到 path,把 path 存入到 <li> 节点中的 data-path 属性中。在删除的时候直接取 <li> 里的 data-path 然后通过 removeDoc 接口删除。

而 removeDoc 这个接口只支持传入 path 不支持传入 id,在需要直接使用接口删除某个 doc 时较为麻烦。

Describe the optimal solution

建议新增一个接口 /api/filetree/getPathByID,可以根据 id 获取到 doc 的实际存储路径,然后可以将该路径传入 removeDoc 接口中。

代码已提交 ytm157@33a927e ,如果 OK 的话将发起一个PR。

Describe the candidate solution

No response

Other information

No response

@88250
Copy link
Member

88250 commented Aug 28, 2024

欢迎 PR。

@88250
Copy link
Member

88250 commented Aug 28, 2024

已经合并,感谢贡献。

@88250 88250 closed this as completed Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants