Updated Custom request handler (markdown)

zadam 2020-06-22 23:12:53 +02:00
parent f1d6802b6d
commit 9e57181a12

@ -15,8 +15,9 @@ if (req.method == 'POST' && secret === 'secret-password') {
// alternetively you can just use constant noteId for simplicity (get that from "Note Info" dialog of the desired parent note)
const targetParentNoteId = await api.currentNote.getRelationValue('targetNote');
await api.createTextNote(targetParentNoteId, title, content);
res.send(201);
const {note} = await api.createTextNote(targetParentNoteId, title, content);
res.status(201).json(note);
}
else {
res.send(400);