mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-01 14:28:49 +01:00
🧑💻 Add internal kernel API /api/attr/batchGetBlockAttrs https://github.com/siyuan-note/siyuan/issues/11786
This commit is contained in:
parent
17dce8ebd2
commit
675ad65bd1
5 changed files with 92 additions and 21 deletions
|
|
@ -33,6 +33,24 @@ func getBookmarkLabels(c *gin.Context) {
|
|||
ret.Data = model.BookmarkLabels()
|
||||
}
|
||||
|
||||
func batchGetBlockAttrs(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
ids := arg["ids"].([]interface{})
|
||||
var idList []string
|
||||
for _, id := range ids {
|
||||
idList = append(idList, id.(string))
|
||||
}
|
||||
|
||||
ret.Data = model.BatchGetBlockAttrs(idList)
|
||||
}
|
||||
|
||||
func getBlockAttrs(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue