mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
🎨 Update kernel API getIDsByHPath https://github.com/siyuan-note/siyuan/issues/10091
This commit is contained in:
parent
ac30332d40
commit
c378afe485
1 changed files with 4 additions and 0 deletions
|
|
@ -1199,6 +1199,7 @@ func GetFullHPathByID(id string) (hPath string, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetIDsByHPath(hpath, boxID string) (ret []string, err error) {
|
func GetIDsByHPath(hpath, boxID string) (ret []string, err error) {
|
||||||
|
ret = []string{}
|
||||||
roots := treenode.GetBlockTreeRootsByHPath(boxID, hpath)
|
roots := treenode.GetBlockTreeRootsByHPath(boxID, hpath)
|
||||||
if 1 > len(roots) {
|
if 1 > len(roots) {
|
||||||
return
|
return
|
||||||
|
|
@ -1208,6 +1209,9 @@ func GetIDsByHPath(hpath, boxID string) (ret []string, err error) {
|
||||||
ret = append(ret, root.ID)
|
ret = append(ret, root.ID)
|
||||||
}
|
}
|
||||||
ret = gulu.Str.RemoveDuplicatedElem(ret)
|
ret = gulu.Str.RemoveDuplicatedElem(ret)
|
||||||
|
if 1 > len(ret) {
|
||||||
|
ret = []string{}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue