Implement endpoint to retrieve notifications

This commit is contained in:
headlessdev 2025-04-17 15:16:38 +02:00
parent 631c5b0c3b
commit e7e873c75c

View File

@ -0,0 +1,16 @@
import { NextResponse, NextRequest } from "next/server";
import { prisma } from "@/lib/prisma";
export async function POST(request: NextRequest) {
try {
const notifications = await prisma.notification.findMany();
return NextResponse.json({
notifications
});
} catch (error: any) {
return NextResponse.json({ error: error.message }, { status: 500 });
}
}