diff options
author | 2021-09-06 23:13:22 +0200 | |
---|---|---|
committer | 2021-09-06 23:13:22 +0200 | |
commit | 569bdb8c5d7538fa0ea8a99ff2f8376f7cbfa51a (patch) | |
tree | 8d1cb94a56d60b9d726222277b7516fc59895613 /pages/api/notes/index.js | |
parent | 275bd1d0a9aea90696c145cf992d522a0d6b0aa8 (diff) | |
download | my_apps-569bdb8c5d7538fa0ea8a99ff2f8376f7cbfa51a.tar.gz my_apps-569bdb8c5d7538fa0ea8a99ff2f8376f7cbfa51a.tar.bz2 my_apps-569bdb8c5d7538fa0ea8a99ff2f8376f7cbfa51a.zip |
added stadard linter
Diffstat (limited to 'pages/api/notes/index.js')
-rw-r--r-- | pages/api/notes/index.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/pages/api/notes/index.js b/pages/api/notes/index.js index f62f849..16cb88c 100644 --- a/pages/api/notes/index.js +++ b/pages/api/notes/index.js @@ -15,7 +15,7 @@ export default withSession(async (req, res) => { throw new Error('Something went wrong') } - const {notes} = await NoteList.getList(user.noteList) + const { notes } = await NoteList.getList(user.noteList) res.status(200).json(notes) } catch (error) { @@ -25,14 +25,14 @@ export default withSession(async (req, res) => { case 'POST': try { const user = req.session.get('user') - const {title, content} = req.body + const { title, content } = req.body if (!user || !user?.isVerified || !content) { throw new Error('Something went wrong') } - const note = await Note.create({content}) - const {notes} = await NoteList.addNote(user.noteList, note._id, title) + const note = await Note.create({ content }) + const { notes } = await NoteList.addNote(user.noteList, note._id, title) res.status(200).json(notes) } catch (error) { @@ -44,5 +44,3 @@ export default withSession(async (req, res) => { break } }) - - |