Add Notification Provider

This commit is contained in:
headlesdev
2025-05-25 00:32:16 +02:00
parent ddc88796d2
commit 6ba144b7bd
6 changed files with 153 additions and 6 deletions

View File

@@ -14,8 +14,10 @@ export async function POST(request: NextRequest) {
const body = await request.json();
const { name, type, config } = schema.parse(body);
const parsedConfig = JSON.parse(config);
const notification = await prisma.notificationProvider.create({
data: { name, type: type as NotificationType, config, tests: {} },
data: { name, type: type as NotificationType, config: parsedConfig},
});
return NextResponse.json({ notification }, { status: 201 });