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

@@ -2,6 +2,7 @@ import {
fetchAlerts,
createAlert,
removeAlert,
fetchNotifications,
updateNotifications,
updateNotification,
} from '../alerts.js';
@@ -24,6 +25,14 @@ export async function removeAlertApi(req, res) {
res.status(204).send();
}
export async function fetchNotificationsApi(req, res) {
const notifications = await fetchNotifications(req.user, {
limit: req.query.limit || 10,
});
res.send(notifications);
}
export async function updateNotificationsApi(req, res) {
await updateNotifications(req.body, req.user);