mirror of
https://github.com/zadam/trilium.git
synced 2025-11-09 14:55:50 +01:00
add api.runAsyncOnBackendWithManualTransactionHandling() variant and add toast warnings about improper usage.
This commit is contained in:
@@ -302,7 +302,8 @@ function register(app) {
|
||||
|
||||
apiRoute(GET, '/api/database/check-integrity', databaseRoute.checkIntegrity);
|
||||
|
||||
apiRoute(PST, '/api/script/exec', scriptRoute.exec);
|
||||
route(PST, '/api/script/exec', [auth.checkApiAuth, csrfMiddleware], scriptRoute.exec, apiResultHandler, false);
|
||||
|
||||
apiRoute(PST, '/api/script/run/:noteId', scriptRoute.run);
|
||||
apiRoute(GET, '/api/script/startup', scriptRoute.getStartupBundles);
|
||||
apiRoute(GET, '/api/script/widgets', scriptRoute.getWidgetBundles);
|
||||
@@ -449,7 +450,7 @@ function route(method, path, middleware, routeHandler, resultHandler = null, tra
|
||||
return;
|
||||
}
|
||||
|
||||
if (result && result.then) { // promise
|
||||
if (result?.then) { // promise
|
||||
result
|
||||
.then(promiseResult => handleResponse(resultHandler, req, res, promiseResult, start))
|
||||
.catch(e => handleException(e, method, path, res));
|
||||
|
||||
Reference in New Issue
Block a user