From 70c14b0882f3872e5ea23b994550ded32cd23a18 Mon Sep 17 00:00:00 2001 From: zadam Date: Thu, 28 Oct 2021 20:51:59 +0200 Subject: [PATCH] Updated Custom request handler (markdown) --- Custom-request-handler.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Custom-request-handler.md b/Custom-request-handler.md index 5244f52..5fa0fd6 100644 --- a/Custom-request-handler.md +++ b/Custom-request-handler.md @@ -13,11 +13,12 @@ if (req.method == 'POST' && secret === 'secret-password') { // notes must be saved somewhere in the tree hierarchy specified by a parent note. // This is defined by a relation from this code note to the "target" parent note // 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'); + const targetParentNoteId = api.currentNote.getRelationValue('targetNote'); - const {note} = await api.createTextNote(targetParentNoteId, title, content); + const {note} = api.createTextNote(targetParentNoteId, title, content); + const notePojo = note.getPojo(); - res.status(201).json(note); + res.status(201).json(notePojo); } else { res.send(400);