useNotifications Hook

This commit is contained in:
headlesdev
2025-05-24 23:03:10 +02:00
parent 913dd7dd63
commit ddc88796d2
4 changed files with 54 additions and 2 deletions

View File

@@ -0,0 +1,11 @@
import { NextRequest, NextResponse } from "next/server";
import prisma from "@/app/prisma";
export async function GET(request: NextRequest) {
try {
const notifications = await prisma.notificationProvider.findMany();
return NextResponse.json({ notifications });
} catch (error: any) {
return NextResponse.json({ error: "Internal Server Error" }, { status: 500 });
}
}

View File

@@ -69,7 +69,7 @@ export async function GET(request: NextRequest) {
id: String(network.id),
siteId: String(network.siteId)
})) || []
} as Site;
} as unknown as Site;
});
const total = filteredSites.length;