Skip to content

Commit

Permalink
🎨 Support listing database mirror blocks in a floating window #10538
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Mar 8, 2024
1 parent b7e3e5f commit 58b76e8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions kernel/api/av.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)

func getMirrorDatabaseBlocks(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)

arg, ok := util.JsonArg(c, ret)
if !ok {
return
}

avID := arg["avID"].(string)
ret.Data = av.GetMirrorBlockIDs(avID)
}

func searchTableView(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
Expand Down
1 change: 1 addition & 0 deletions kernel/api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/av/getAttributeViewPrimaryKeyValues", model.CheckAuth, model.CheckReadonly, getAttributeViewPrimaryKeyValues)
ginServer.Handle("POST", "/api/av/setDatabaseBlockView", model.CheckAuth, model.CheckReadonly, setDatabaseBlockView)
ginServer.Handle("POST", "/api/av/searchTableView", model.CheckAuth, model.CheckReadonly, searchTableView)
ginServer.Handle("POST", "/api/av/getMirrorDatabaseBlocks", model.CheckAuth, model.CheckReadonly, getMirrorDatabaseBlocks)

ginServer.Handle("POST", "/api/ai/chatGPT", model.CheckAuth, chatGPT)
ginServer.Handle("POST", "/api/ai/chatGPTWithAction", model.CheckAuth, chatGPTWithAction)
Expand Down

0 comments on commit 58b76e8

Please sign in to comment.