🎨 Add internal kernel API /api/setting/refreshVirtualBlockRef Fix https://github.com/siyuan-note/siyuan/issues/9829

This commit is contained in:
Daniel 2023-12-06 16:25:49 +08:00
parent b06cc3dc10
commit d6765e0303
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 8 additions and 4 deletions

View file

@ -306,6 +306,7 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/setting/setFlashcard", model.CheckAuth, model.CheckReadonly, setFlashcard)
ginServer.Handle("POST", "/api/setting/setAI", model.CheckAuth, model.CheckReadonly, setAI)
ginServer.Handle("POST", "/api/setting/setBazaar", model.CheckAuth, model.CheckReadonly, setBazaar)
ginServer.Handle("POST", "/api/setting/refreshVirtualBlockRef", model.CheckAuth, model.CheckReadonly, refreshVirtualBlockRef)
ginServer.Handle("POST", "/api/graph/resetGraph", model.CheckAuth, model.CheckReadonly, resetGraph)
ginServer.Handle("POST", "/api/graph/resetLocalGraph", model.CheckAuth, model.CheckReadonly, resetLocalGraph)

View file

@ -29,6 +29,13 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func refreshVirtualBlockRef(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
model.ResetVirtualBlockRefCache()
}
func setBazaar(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)