mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-28 19:26:09 +01:00
🎨 New a row in the database no longer require to create a relevant doc https://github.com/siyuan-note/siyuan/issues/9294
This commit is contained in:
parent
26db301a12
commit
ddffc27745
3 changed files with 22 additions and 10 deletions
|
|
@ -26,6 +26,7 @@ import (
|
|||
"unicode/utf8"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
"github.com/88250/lute/ast"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/siyuan-note/siyuan/kernel/filesys"
|
||||
"github.com/siyuan-note/siyuan/kernel/model"
|
||||
|
|
@ -481,6 +482,12 @@ func createDocWithMd(c *gin.Context) {
|
|||
parentID = parentIDArg.(string)
|
||||
}
|
||||
|
||||
id := ast.NewNodeID()
|
||||
idArg := arg["id"]
|
||||
if nil != idArg {
|
||||
id = idArg.(string)
|
||||
}
|
||||
|
||||
hPath := arg["path"].(string)
|
||||
markdown := arg["markdown"].(string)
|
||||
|
||||
|
|
@ -496,7 +503,7 @@ func createDocWithMd(c *gin.Context) {
|
|||
hPath = "/" + hPath
|
||||
}
|
||||
|
||||
id, err := model.CreateWithMarkdown(notebook, hPath, markdown, parentID)
|
||||
err := model.CreateWithMarkdown(notebook, hPath, markdown, parentID, id)
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue