source: Klonkt/src/routes/notifications.js@ 3f4049e

main
Last change on this file since 3f4049e was c9c6a2d, checked in by roboburr <roboburr@…>, 3 months ago

feat(meldingen): notifications — reply on comment, comment on post, like on post

For every logged-in user (Google visitors/fans and admin). Bell icon in the
header with unread counter + notifications page /notifications (via user menu
desktop + profile sheet mobile; badge also on the mobile Profile tab). Opening =
read. Triggers in comments (reply→comment author, top-level→post author) and
like (→post author); notify() skips notifying yourself. Table notifications
+ NotificationService. NL/EN/DE.

Co-Authored-By: Claude <noreply@…>

  • Property mode set to 100644
File size: 683 bytes
Line 
1/**
2 * GET /notifications — meldingenpagina voor de ingelogde gebruiker.
3 * Openen = alles als gelezen markeren (de teller in de header valt dan weg).
4 */
5import express from 'express';
6import { requireAuth } from '../middleware/auth.js';
7import { renderPage } from '../middleware/render.js';
8import { list, markAllRead } from '../services/NotificationService.js';
9
10const router = express.Router();
11
12router.get('/', requireAuth, (req, res) => {
13 const uid = req.session.user.id;
14 const items = list(uid, 50);
15 markAllRead(uid);
16 renderPage(req, res, 'pages/notifications', {
17 pageTitle: 'Meldingen',
18 bodyClass: 'on-special',
19 items,
20 });
21});
22
23export default router;
Note: See TracBrowser for help on using the repository browser.