mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
Updated Custom request handler (markdown)
parent
c70cbe35b6
commit
5ee48c68b8
@ -10,8 +10,9 @@ const {req, res} = api;
|
|||||||
const {secret, title, content} = req.body;
|
const {secret, title, content} = req.body;
|
||||||
|
|
||||||
if (req.method == 'POST' && secret === 'secret-password') {
|
if (req.method == 'POST' && secret === 'secret-password') {
|
||||||
// notes must be saved somewhere - under a parent. This is specified by a relation to the "target note"
|
// notes must be saved somewhere in the tree hierarchy specified by a parent note.
|
||||||
// alternetively you can just use constant noteId for simplicity (get that from "Note Info" dialog)
|
// 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 = await api.currentNote.getRelationValue('targetNote');
|
||||||
|
|
||||||
await api.createTextNote(targetParentNoteId, title, content);
|
await api.createTextNote(targetParentNoteId, title, content);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user