mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-17 15:36:50 +00:00
Add pushover to notification add api
This commit is contained in:
parent
e0c159cb71
commit
d51908b48d
@ -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,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user