Skip to content

Build your personal knowledge base with Trilium Notes

allow async scripts in runOnBackend(), fixes #2243

zadam069fbee3a66d
diff --git a/src/routes/api/script.js b/src/routes/api/script.js
index 11cc025f94..b591307df9 100644
--- a/src/routes/api/script.js
+++ b/src/routes/api/script.js
@@ -5,11 +5,11 @@ const attributeService = require('../../services/attributes');
const becca = require('../../becca/becca');
const syncService = require('../../services/sync');
-function exec(req) {
+async function exec(req) {
try {
const {body} = req;
- const result = scriptService.executeScript(
+ const result = await scriptService.executeScript(
body.script,
body.params,
body.startNoteId,