import { NextResponse, NextRequest } from "next/server"; import { prisma } from "@/lib/prisma"; export async function POST(request: NextRequest) { try { const body = await request.json(); const id = Number(body.id); if (!id) { return NextResponse.json({ error: "Missing ID" }, { status: 400 }); } await prisma.notification.delete({ where: { id: id } }); return NextResponse.json({ success: true }); } catch (error: any) { return NextResponse.json({ error: error.message }, { status: 500 }); } }