mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-18 16:07:10 +00:00
Add Gotify and ntfy fields to AddRequest interface and update POST method to handle new notification types
This commit is contained in:
parent
93bffa29cc
commit
300547e59e
@ -13,12 +13,16 @@ interface AddRequest {
|
|||||||
telegramToken?: string;
|
telegramToken?: string;
|
||||||
telegramChatId?: string;
|
telegramChatId?: string;
|
||||||
discordWebhook?: string;
|
discordWebhook?: string;
|
||||||
|
gotifyUrl?: string;
|
||||||
|
gotifyToken?: string;
|
||||||
|
ntfyUrl?: string;
|
||||||
|
ntfyToken?: 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 } = body;
|
const { type, smtpHost, smtpPort, smtpSecure, smtpUsername, smtpPassword, smtpFrom, smtpTo, telegramToken, telegramChatId, discordWebhook, gotifyUrl, gotifyToken, ntfyUrl, ntfyToken } = body;
|
||||||
|
|
||||||
const notification = await prisma.notification.create({
|
const notification = await prisma.notification.create({
|
||||||
data: {
|
data: {
|
||||||
@ -33,6 +37,10 @@ export async function POST(request: NextRequest) {
|
|||||||
telegramChatId: telegramChatId,
|
telegramChatId: telegramChatId,
|
||||||
telegramToken: telegramToken,
|
telegramToken: telegramToken,
|
||||||
discordWebhook: discordWebhook,
|
discordWebhook: discordWebhook,
|
||||||
|
gotifyUrl: gotifyUrl,
|
||||||
|
gotifyToken: gotifyToken,
|
||||||
|
ntfyUrl: ntfyUrl,
|
||||||
|
ntfyToken: ntfyToken,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user