Skip to content

Commit e7a4996

Browse files
committed
Update note title and history in update api
Signed-off-by: James Tsai <jamesscamel@gmail.com>
1 parent 091c77b commit e7a4996

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/note/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ const updateNote = async (req, res) => {
289289
const now = Date.now()
290290
const content = req.body.content
291291
const updated = await note.update({
292+
title: Note.parseNoteTitle(content),
292293
content: content,
293294
lastchangeAt: now,
294295
authorship: [
@@ -307,6 +308,8 @@ const updateNote = async (req, res) => {
307308
return errorInternalError(req, res)
308309
}
309310

311+
updateHistory(req.user.id, note)
312+
310313
Revision.saveNoteRevision(note, (err, revision) => {
311314
if (err) {
312315
logger.error(err)

0 commit comments

Comments
 (0)