comment_new.go: create page before inserting comment
Fixes https://gitlab.com/commento/commento/issues/173
This commit is contained in:
@@ -30,6 +30,10 @@ func commentNew(commenterHex string, domain string, path string, parentHex strin
|
||||
|
||||
html := markdownToHtml(markdown)
|
||||
|
||||
if err = pageNew(domain, path); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
statement := `
|
||||
INSERT INTO
|
||||
comments (commentHex, domain, path, commenterHex, parentHex, markdown, html, creationDate, state)
|
||||
@@ -41,10 +45,6 @@ func commentNew(commenterHex string, domain string, path string, parentHex strin
|
||||
return "", errorInternal
|
||||
}
|
||||
|
||||
if err = pageNew(domain, path); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return commentHex, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user