This commit is contained in:
Daniel 2024-01-12 09:41:08 +08:00
parent ac30332d40
commit c378afe485
No known key found for this signature in database
GPG Key ID: 86211BA83DF03017

View File

@ -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
} }