🧑‍💻 Add kernel API /api/block/getBlockDOMs https://github.com/siyuan-note/siyuan/issues/15004

This commit is contained in:
Daniel 2025-06-10 17:05:08 +08:00
parent 475eeb6b15
commit f4a5bd105f
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 38 additions and 1 deletions

View file

@ -653,6 +653,25 @@ func getBlockDOM(c *gin.Context) {
}
}
func getBlockDOMs(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
idsArg := arg["ids"].([]interface{})
var ids []string
for _, id := range idsArg {
ids = append(ids, id.(string))
}
doms := model.GetBlockDOMs(ids)
ret.Data = doms
}
func getBlockKramdown(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)