mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-05 23:21:47 +01:00
🎨 Add kernel API /api/filetree/getIDsByHPath https://github.com/siyuan-note/siyuan/issues/9654
This commit is contained in:
parent
8eb5e53f81
commit
38099e4892
6 changed files with 115 additions and 2 deletions
|
|
@ -1183,6 +1183,19 @@ func GetFullHPathByID(id string) (hPath string, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func GetIDsByHPath(hpath, boxID string) (ret []string, err error) {
|
||||
roots := treenode.GetBlockTreeRootsByHPath(boxID, hpath)
|
||||
if 1 > len(roots) {
|
||||
return
|
||||
}
|
||||
|
||||
for _, root := range roots {
|
||||
ret = append(ret, root.ID)
|
||||
}
|
||||
ret = gulu.Str.RemoveDuplicatedElem(ret)
|
||||
return
|
||||
}
|
||||
|
||||
func MoveDocs(fromPaths []string, toBoxID, toPath string, callback interface{}) (err error) {
|
||||
toBox := Conf.Box(toBoxID)
|
||||
if nil == toBox {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue