Add pushover to notification add api

This commit is contained in:
headlessdev 2025-04-21 15:28:36 +02:00
parent e0c159cb71
commit d51908b48d

View File

@ -17,12 +17,15 @@ interface AddRequest {
gotifyToken?: string; gotifyToken?: string;
ntfyUrl?: string; ntfyUrl?: string;
ntfyToken?: string; ntfyToken?: string;
pushoverUrl?: string;
pushoverToken?: string;
pushoverUser?: string;
} }
export async function POST(request: NextRequest) { export async function POST(request: NextRequest) {
try { try {
const body: AddRequest = await request.json(); const body: AddRequest = await request.json();
const { type, smtpHost, smtpPort, smtpSecure, smtpUsername, smtpPassword, smtpFrom, smtpTo, telegramToken, telegramChatId, discordWebhook, gotifyUrl, gotifyToken, ntfyUrl, ntfyToken } = body; const { type, smtpHost, smtpPort, smtpSecure, smtpUsername, smtpPassword, smtpFrom, smtpTo, telegramToken, telegramChatId, discordWebhook, gotifyUrl, gotifyToken, ntfyUrl, ntfyToken, pushoverUrl, pushoverToken, pushoverUser } = body;
const notification = await prisma.notification.create({ const notification = await prisma.notification.create({
data: { data: {
@ -41,6 +44,9 @@ export async function POST(request: NextRequest) {
gotifyToken: gotifyToken, gotifyToken: gotifyToken,
ntfyUrl: ntfyUrl, ntfyUrl: ntfyUrl,
ntfyToken: ntfyToken, ntfyToken: ntfyToken,
pushoverUrl: pushoverUrl,
pushoverToken: pushoverToken,
pushoverUser: pushoverUser,
} }
}); });