From 74abb7052d3af3c305cfe3c525aea311ccc446e1 Mon Sep 17 00:00:00 2001 From: piotrruss Date: Thu, 12 Aug 2021 19:00:50 +0200 Subject: crypt notes content --- pages/api/notes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pages/api/notes.js') diff --git a/pages/api/notes.js b/pages/api/notes.js index 73a7217..dd31c6f 100644 --- a/pages/api/notes.js +++ b/pages/api/notes.js @@ -78,7 +78,7 @@ export default withSession(async (req, res) => { throw new Error('Something went wrong') } - await Note.findByIdAndUpdate(noteId, {content}, {new: true}) + await Note.updateNote(noteId, content) const notes = await NoteList.findOneAndUpdate( { _id: user.noteList, "notes.noteId": noteId }, -- cgit v1.2.3