🐛 The save path is incorrect when creating a sub-doc by ref in a doc with the same name Fix https://github.com/siyuan-note/siyuan/issues/8138

This commit is contained in:
Liang Ding 2023-05-01 12:35:17 +08:00
parent c7875757c0
commit f3dd8e5315
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
4 changed files with 60 additions and 5 deletions

View file

@ -475,6 +475,12 @@ func createDocWithMd(c *gin.Context) {
return
}
var parentID string
parentIDArg := arg["parentID"]
if nil != parentIDArg {
parentID = parentIDArg.(string)
}
hPath := arg["path"].(string)
markdown := arg["markdown"].(string)
@ -490,7 +496,7 @@ func createDocWithMd(c *gin.Context) {
hPath = "/" + hPath
}
id, err := model.CreateWithMarkdown(notebook, hPath, markdown)
id, err := model.CreateWithMarkdown(notebook, hPath, markdown, parentID)
if nil != err {
ret.Code = -1
ret.Msg = err.Error()