🎨 API /api/filetree/duplicateDoc 返回新文档的 id/box/path/hpath Fix https://github.com/siyuan-note/siyuan/issues/5669

This commit is contained in:
Liang Ding 2022-08-19 16:26:57 +08:00
parent a7d3e8a0c8
commit 6c652fab6b
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 22 additions and 15 deletions

View file

@ -307,7 +307,7 @@ func duplicateDoc(c *gin.Context) {
}
id := arg["id"].(string)
err := model.DuplicateDoc(id)
newTree, err := model.DuplicateDoc(id)
if nil != err {
ret.Code = -1
ret.Msg = err.Error()
@ -327,6 +327,13 @@ func duplicateDoc(c *gin.Context) {
}
pushCreate(box, p, tree.Root.ID, arg)
ret.Data = map[string]interface{}{
"id": newTree.Root.ID,
"notebook": notebook,
"path": newTree.Path,
"hPath": newTree.HPath,
}
}
func createDoc(c *gin.Context) {