diff --git a/app/api/notifications/get/route.ts b/app/api/notifications/get/route.ts new file mode 100644 index 0000000..dff6e7f --- /dev/null +++ b/app/api/notifications/get/route.ts @@ -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 }); + } +} \ No newline at end of file