mirror of
https://github.com/zadam/trilium.git
synced 2026-03-22 08:13:46 +01:00
fix(share): wire assertShareDbReady into router middleware — address code review
This commit is contained in:
parent
1990a990c3
commit
e9987b40e6
@ -123,6 +123,13 @@ function render404(res: Response) {
|
||||
}
|
||||
|
||||
function register(router: Router) {
|
||||
// Guard: if the share DB is not yet initialized, return 503 for all /share routes.
|
||||
router.use((_req: Request, res: Response, next) => {
|
||||
if (!assertShareDbReady(res)) {
|
||||
return;
|
||||
}
|
||||
next();
|
||||
});
|
||||
|
||||
function renderNote(note: SNote, req: Request, res: Response) {
|
||||
if (!note) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user