mirror of
https://github.com/status-im/codimd.git
synced 2025-02-04 15:34:28 +00:00
Update note title and history in update api
Signed-off-by: James Tsai <jamesscamel@gmail.com>
This commit is contained in:
parent
091c77bdb1
commit
e7a4996cbe
@ -289,6 +289,7 @@ const updateNote = async (req, res) => {
|
||||
const now = Date.now()
|
||||
const content = req.body.content
|
||||
const updated = await note.update({
|
||||
title: Note.parseNoteTitle(content),
|
||||
content: content,
|
||||
lastchangeAt: now,
|
||||
authorship: [
|
||||
@ -307,6 +308,8 @@ const updateNote = async (req, res) => {
|
||||
return errorInternalError(req, res)
|
||||
}
|
||||
|
||||
updateHistory(req.user.id, note)
|
||||
|
||||
Revision.saveNoteRevision(note, (err, revision) => {
|
||||
if (err) {
|
||||
logger.error(err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user