feat(frontend): Benachrichtigungssystem (Modul 26)

NotificationBell in der Kopfzeile: ungelesene Anzahl als Badge,
Dropdown mit Prioritaets-Badges (INFO/HINWEIS/WARNUNG/KRITISCH),
Klick markiert als gelesen und fuehrt zum verknuepften Objekt.
Ausserdem IDOR im Backend gefunden und behoben (siehe vorheriger
Commit) - live mit einem echten Datensatz verifiziert.
This commit is contained in:
Nick Szaunig committed 2026-08-22 22:50:45 +02:00
1 parent 75f0d4fd51
commit 0fc13952fb
5 files changed
+125 -2

No files matched your search

@@ -0,0 +1,10 @@
import { apiFetch } from "@/lib/auth/api-client";
import { Notification } from "./types";
export function fetchNotifications(unreadOnly = false): Promise<Notification[]> {
return apiFetch<Notification[]>(`/notifications?unreadOnly=${unreadOnly}`);
}
export function markNotificationRead(id: string): Promise<Notification> {
return apiFetch<Notification>(`/notifications/${id}/read`, { method: "POST" });
}
@@ -0,0 +1,11 @@
export type NotificationPriority = "INFO" | "HINWEIS" | "WARNUNG" | "KRITISCH";
export interface Notification {
id: string;
priority: NotificationPriority;
message: string;
relatedType: string | null;
relatedId: string | null;
read: boolean;
createdAt: string;
}