mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 01:36:29 -05:00
Merge pull request #566 from codimd/fix/306-api-titles
Save note title to database when creating a note
This commit is contained in:
commit
db2fcdb516
1 changed files with 2 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue