From 9e57181a12a513ae4604bf43b2ca23a84a383f9f Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 22 Jun 2020 23:12:53 +0200 Subject: [PATCH] Updated Custom request handler (markdown) --- Custom-request-handler.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Custom-request-handler.md b/Custom-request-handler.md index f62aeaa..47eee2f 100644 --- a/Custom-request-handler.md +++ b/Custom-request-handler.md @@ -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);