mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 08:30:12 +01:00
🧑💻 Add internal kernel API /api/block/getBlocksIndexes Fix https://github.com/siyuan-note/siyuan/issues/10608
This commit is contained in:
parent
0daa752ba9
commit
095dfc2b35
3 changed files with 52 additions and 0 deletions
|
|
@ -436,6 +436,24 @@ func getBlockIndex(c *gin.Context) {
|
|||
ret.Data = index
|
||||
}
|
||||
|
||||
func getBlocksIndexes(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))
|
||||
}
|
||||
index := model.GetBlocksIndexes(ids)
|
||||
ret.Data = index
|
||||
}
|
||||
|
||||
func getBlockInfo(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue