From 6ac0d0ca7a8c8cf2d9a29822c7356dedf0464573 Mon Sep 17 00:00:00 2001 From: zadam Date: Fri, 17 Feb 2023 23:02:54 +0100 Subject: [PATCH] don't use deprecated/removed functions --- Day notes.md | 2 +- Release notes v0.48.md | 10 +++++----- Task-manager.md | 2 +- Weight tracker.md | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Day notes.md b/Day notes.md index d5d4ee8..20ff03c 100644 --- a/Day notes.md +++ b/Day notes.md @@ -36,7 +36,7 @@ It's possible to customize the title of generated date notes by defining a `#dat ## Implementation -Trilium has some special support for day notes in the form of [backend Script API](https://zadam.github.io/trilium/backend_api/BackendScriptApi.html) - see e.g. getDateNote() function. +Trilium has some special support for day notes in the form of [backend Script API](https://zadam.github.io/trilium/backend_api/BackendScriptApi.html) - see e.g. getDayNote() function. Day (and year, month) notes are created with a label - e.g. `#dateNote="2018-08-16"` this can then be used by other scripts to add new notes to day note etc. diff --git a/Release notes v0.48.md b/Release notes v0.48.md index 237b80a..c0db2ca 100644 --- a/Release notes v0.48.md +++ b/Release notes v0.48.md @@ -63,8 +63,8 @@ e.g. old script looked like this: const todayDateStr = api.formatDateISO(new Date()); - const todayNote = await api.runOnServer(async todayDateStr => { - const dateNote = await api.getDateNote(todayDateStr); + const todayNote = await api.runOnBackend(async todayDateStr => { + const dateNote = await api.getDayNote(todayDateStr); ({note: logNote} = await api.createNote(dateNote.noteId, 'log')); }, [todayDateStr]); @@ -75,8 +75,8 @@ all the `await` (and `async`) should disappear from the backend code, but should const todayDateStr = api.formatDateISO(new Date()); - const todayNote = await api.runOnServer(todayDateStr => { - const dateNote = api.getDateNote(todayDateStr); + const todayNote = await api.runOnBackend(todayDateStr => { + const dateNote = api.getDayNote(todayDateStr); ({note: logNote} = api.createNote(dateNote.noteId, 'log')); }, [todayDateStr]); @@ -117,4 +117,4 @@ This prefixing is not needed anymore (and also doesn't work anymore). Remove the body .note-detail-editable-text, body .note-detail-readonly-text { font-size: 120%; - } \ No newline at end of file + } diff --git a/Task-manager.md b/Task-manager.md index 25777f7..08cce5e 100644 --- a/Task-manager.md +++ b/Task-manager.md @@ -27,7 +27,7 @@ api.addButtonToToolbar({ action: async () => { // creating notes is backend (server) responsibility so we need to pass // the control there - const taskNoteId = await api.runOnServer(async () => { + const taskNoteId = await api.runOnBackend(async () => { const todoRootNote = await api.getNoteWithLabel('taskTodoRoot'); const {note} = await api.createNote(todoRootNote.noteId, 'new task', ''); diff --git a/Weight tracker.md b/Weight tracker.md index a8f3b3a..911df08 100644 --- a/Weight tracker.md +++ b/Weight tracker.md @@ -20,7 +20,7 @@ To get an idea of the script, here's the "JS code" note content: ```javascript async function getChartData() { - const days = await api.runOnServer(async () => { + const days = await api.runOnBackend(async () => { const notes = await api.getNotesWithLabel('weight'); const days = [];