Added notification bell, WIP.

This commit is contained in:
2024-05-20 06:29:10 +02:00
parent dc5affb4cf
commit 342ba6191e
7 changed files with 141 additions and 53 deletions

View File

@@ -51,6 +51,8 @@ import {
updateNotificationsApi,
} from './alerts.js';
import { fetchNotifications } from '../alerts.js';
import initLogger from '../logger.js';
const logger = initLogger();
@@ -164,6 +166,8 @@ export default async function initServer() {
router.get('/api/tags', fetchTagsApi);
router.get('*', async (req, res, next) => {
const notifications = await fetchNotifications(req.user, { limit: 20 });
const pageContextInit = {
urlOriginal: req.originalUrl,
urlQuery: req.query, // vike's own query does not apply boolean parser
@@ -185,6 +189,7 @@ export default async function initServer() {
maxAggregateSize: config.database.manticore.maxAggregateSize,
media: config.media,
},
notifications,
};
const pageContext = await renderPage(pageContextInit);