mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 API /api/filetree/duplicateDoc 返回新文档的 id/box/path/hpath Fix https://github.com/siyuan-note/siyuan/issues/5669
This commit is contained in:
parent
a7d3e8a0c8
commit
6c652fab6b
2 changed files with 22 additions and 15 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue