From 300547e59e4d588c6bd22cce97c46d5eb4c7dfc8 Mon Sep 17 00:00:00 2001 From: headlessdev Date: Sat, 19 Apr 2025 13:11:18 +0200 Subject: [PATCH] Add Gotify and ntfy fields to AddRequest interface and update POST method to handle new notification types --- app/api/notifications/add/route.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/api/notifications/add/route.ts b/app/api/notifications/add/route.ts index 721bf5a..286bb84 100644 --- a/app/api/notifications/add/route.ts +++ b/app/api/notifications/add/route.ts @@ -13,12 +13,16 @@ interface AddRequest { telegramToken?: string; telegramChatId?: string; discordWebhook?: string; + gotifyUrl?: string; + gotifyToken?: string; + ntfyUrl?: string; + ntfyToken?: string; } export async function POST(request: NextRequest) { try { const body: AddRequest = await request.json(); - const { type, smtpHost, smtpPort, smtpSecure, smtpUsername, smtpPassword, smtpFrom, smtpTo, telegramToken, telegramChatId, discordWebhook } = body; + const { type, smtpHost, smtpPort, smtpSecure, smtpUsername, smtpPassword, smtpFrom, smtpTo, telegramToken, telegramChatId, discordWebhook, gotifyUrl, gotifyToken, ntfyUrl, ntfyToken } = body; const notification = await prisma.notification.create({ data: { @@ -33,6 +37,10 @@ export async function POST(request: NextRequest) { telegramChatId: telegramChatId, telegramToken: telegramToken, discordWebhook: discordWebhook, + gotifyUrl: gotifyUrl, + gotifyToken: gotifyToken, + ntfyUrl: ntfyUrl, + ntfyToken: ntfyToken, } });