This commit is contained in:
zadam
2020-06-20 13:18:03 +02:00
parent 88348c560c
commit 6207203b35
8 changed files with 27 additions and 34 deletions

View File

@@ -89,14 +89,9 @@ function route(method, path, middleware, routeHandler, resultHandler, transactio
cls.set('localNowDateTime', req.headers['`trilium-local-now-datetime`']);
protectedSessionService.setProtectedSessionId(req);
if (transactional) {
return sql.transactional(() => {
return routeHandler(req, res, next);
});
}
else {
return routeHandler(req, res, next);
}
const cb = () => routeHandler(req, res, next);
return transactional ? sql.transactional(cb) : cb();
});
if (resultHandler) {