🎨 提供重建单个文档索引的 API https://github.com/siyuan-note/siyuan/issues/5719

This commit is contained in:
Liang Ding 2022-08-27 22:21:59 +08:00
parent 0959994e73
commit da5f467a5e
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 33 additions and 0 deletions

View file

@ -32,6 +32,25 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func reindexTree(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
path := arg["path"].(string)
err := model.ReindexTree(path)
if nil != err {
ret.Code = -1
ret.Msg = err.Error()
ret.Data = map[string]interface{}{"closeTimeout": 5000}
return
}
}
func refreshFiletree(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)