mirror of
https://github.com/zadam/trilium.git
synced 2025-01-04 06:13:36 +08:00
add sender API to send text notes
This commit is contained in:
parent
6dea73cfe2
commit
4b1d1aba74
1 changed files with 15 additions and 0 deletions
|
@ -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;
|
Loading…
Reference in a new issue