From 4b1d1aba748e9fba3bf7ac12a4e4c7a0b4bb894b Mon Sep 17 00:00:00 2001 From: azivner Date: Sun, 11 Feb 2018 10:54:56 -0500 Subject: [PATCH] add sender API to send text notes --- src/routes/api/sender.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/routes/api/sender.js b/src/routes/api/sender.js index 5fd76f3a4..a85d3e188 100644 --- a/src/routes/api/sender.js +++ b/src/routes/api/sender.js @@ -88,4 +88,19 @@ router.post('/image', checkSenderToken, multer.single('upload'), wrap(async (req res.send({}); })); +router.post('/note', checkSenderToken, wrap(async (req, res, next) => { + const parentNoteId = await date_notes.getDateNoteId(req.headers['x-local-date']); + + await notes.createNewNote(parentNoteId, { + title: req.body.title, + content: req.body.content, + target: 'into', + isProtected: false, + type: 'text', + mime: 'text/html' + }); + + res.send({}); +})); + module.exports = router; \ No newline at end of file