mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 11:26:15 +01:00
support for execution of async functions + integration with backend through server.exec()
This commit is contained in:
@@ -29,6 +29,14 @@ const server = (function() {
|
||||
return await call('DELETE', url);
|
||||
}
|
||||
|
||||
async function exec(script) {
|
||||
if (typeof script === "function") {
|
||||
script = script.toString();
|
||||
}
|
||||
|
||||
return await post('script/exec', { script: script });
|
||||
}
|
||||
|
||||
let i = 1;
|
||||
const reqResolves = {};
|
||||
|
||||
@@ -92,6 +100,6 @@ const server = (function() {
|
||||
post,
|
||||
put,
|
||||
remove,
|
||||
getHeaders
|
||||
exec
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user