🎨 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:
Daniel 2023-09-28 00:15:46 +08:00
parent 26db301a12
commit ddffc27745
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 22 additions and 10 deletions

View file

@ -1028,7 +1028,7 @@ func CreateDocByMd(boxID, p, title, md string, sorts []string) (tree *parse.Tree
return
}
func CreateWithMarkdown(boxID, hPath, md, parentID string) (id string, err error) {
func CreateWithMarkdown(boxID, hPath, md, parentID, id string) (err error) {
box := Conf.Box(boxID)
if nil == box {
err = errors.New(Conf.Language(0))
@ -1038,7 +1038,7 @@ func CreateWithMarkdown(boxID, hPath, md, parentID string) (id string, err error
WaitForWritingFiles()
luteEngine := util.NewLute()
dom := luteEngine.Md2BlockDOM(md, false)
id, _, err = createDocsByHPath(box.ID, hPath, dom, parentID)
_, _, err = createDocsByHPath(box.ID, hPath, dom, parentID, id)
return
}
@ -1442,7 +1442,7 @@ func CreateDailyNote(boxID string) (p string, existed bool, err error) {
return
}
id, existed, err := createDocsByHPath(box.ID, hPath, "", "")
id, existed, err := createDocsByHPath(box.ID, hPath, "", "", "")
if nil != err {
return
}