mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🐛 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:
parent
c7875757c0
commit
f3dd8e5315
4 changed files with 60 additions and 5 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue