notifications
Deploy / deploy (push) Successful in 2m32s

This commit is contained in:
twotalesanimation
2026-06-19 13:25:19 +02:00
parent 1a77a82566
commit 835081c1b9
3 changed files with 242 additions and 55 deletions
+15
View File
@@ -21,6 +21,7 @@ export async function GET() {
return NextResponse.json({ notifications, unreadCount });
}
// Mark all as read
export async function PATCH() {
const session = await auth();
if (!session?.user) {
@@ -34,3 +35,17 @@ export async function PATCH() {
return NextResponse.json({ success: true });
}
// Clear all notifications
export async function DELETE() {
const session = await auth();
if (!session?.user) {
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
}
await db.notification.deleteMany({
where: { userId: session.user.id },
});
return NextResponse.json({ success: true });
}