add "api.runOnFrontend()" to the backend script API

This commit is contained in:
zadam
2023-08-30 23:18:16 +02:00
parent 8da5b90aea
commit 6f7fbacca1
9 changed files with 302 additions and 20 deletions

View File

@@ -4,8 +4,11 @@ import toastService from "./toast.js";
import froca from "./froca.js";
import utils from "./utils.js";
async function getAndExecuteBundle(noteId, originEntity = null) {
const bundle = await server.get(`script/bundle/${noteId}`);
async function getAndExecuteBundle(noteId, originEntity = null, script = null, params = null) {
const bundle = await server.post(`script/bundle/${noteId}`, {
script,
params
});
return await executeBundle(bundle, originEntity);
}