mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-02 13:41:48 +01:00
🎨 Add kernel API /api/block/getChildBlocks Fix https://github.com/siyuan-note/siyuan/issues/8249
This commit is contained in:
parent
897b1d5ccc
commit
b3b891338b
5 changed files with 149 additions and 1 deletions
|
|
@ -481,3 +481,20 @@ func getBlockKramdown(c *gin.Context) {
|
|||
"kramdown": kramdown,
|
||||
}
|
||||
}
|
||||
|
||||
func getChildBlocks(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
id := arg["id"].(string)
|
||||
if util.InvalidIDPattern(id, ret) {
|
||||
return
|
||||
}
|
||||
|
||||
ret.Data = model.GetChildBlocks(id)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue