summaryrefslogtreecommitdiff
path: root/lib/web
diff options
context:
space:
mode:
authorDavid Mehren2020-11-12 19:01:45 +0100
committerGitHub2020-11-12 19:01:45 +0100
commitdb2fcdb516360fa1d5a6afb6963113756e4e1e9c (patch)
tree46092b4a23d9edf116b4fe3f87ae304a4a930a9e /lib/web
parent6e6ce29de3dc2ad34241b3c521289a39812b9076 (diff)
parent9dd74da17f10eb90318a2c2053d05061c3b9df45 (diff)
Merge pull request #566 from codimd/fix/306-api-titles
Save note title to database when creating a note
Diffstat (limited to '')
-rw-r--r--lib/web/note/util.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/web/note/util.js b/lib/web/note/util.js
index f1af1300..9c6c1c8a 100644
--- a/lib/web/note/util.js
+++ b/lib/web/note/util.js
@@ -59,7 +59,8 @@ exports.newNote = function (req, res, body) {
models.Note.create({
ownerId: owner,
alias: req.alias ? req.alias : null,
- content: body
+ content: body,
+ title: models.Note.parseNoteTitle(body)
}).then(function (note) {
return res.redirect(config.serverURL + '/' + (note.alias ? note.alias : models.Note.encodeNoteId(note.id)))
}).catch(function (err) {