mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-29 16:14:43 +00:00
useNotifications Hook
This commit is contained in:
11
app/api/notifications/get/route.ts
Normal file
11
app/api/notifications/get/route.ts
Normal 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 });
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user