Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2025-04-01 12:00:47 +08:00
commit 96271bd284
4 changed files with 16 additions and 0 deletions

View file

@ -27,6 +27,19 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func reloadAttributeView(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
id := arg["id"].(string)
model.ReloadAttrView(id)
}
func duplicateAttributeViewBlock(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)

View file

@ -452,6 +452,7 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/av/getAttributeViewKeysByAvID", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, getAttributeViewKeysByAvID)
ginServer.Handle("POST", "/api/av/duplicateAttributeViewBlock", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, duplicateAttributeViewBlock)
ginServer.Handle("POST", "/api/av/appendAttributeViewDetachedBlocksWithValues", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, appendAttributeViewDetachedBlocksWithValues)
ginServer.Handle("POST", "/api/av/reloadAttributeView", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, reloadAttributeView)
ginServer.Handle("POST", "/api/ai/chatGPT", model.CheckAuth, model.CheckAdminRole, chatGPT)
ginServer.Handle("POST", "/api/ai/chatGPTWithAction", model.CheckAuth, model.CheckAdminRole, chatGPTWithAction)

View file

@ -1080,6 +1080,7 @@ func CreateDailyNote(boxID string) (p string, existed bool, err error) {
FlushTxQueue()
hPath = util.TrimSpaceInPath(hPath)
existRoot := treenode.GetBlockTreeRootByHPath(box.ID, hPath)
if nil != existRoot {
existed = true

View file

@ -40,6 +40,7 @@ func createDocsByHPath(boxID, hPath, content, parentID, id string) (retID string
retID = id
hPath = strings.TrimSuffix(hPath, ".sy")
hPath = util.TrimSpaceInPath(hPath)
if "" != parentID {
// The save path is incorrect when creating a sub-doc by ref in a doc with the same name https://github.com/siyuan-note/siyuan/issues/8138
// 在指定了父文档 ID 的情况下优先查找父文档