Update notification text handling in API and dashboard to support separate application and server notification texts.

This commit is contained in:
headlessdev
2025-04-21 13:22:40 +02:00
parent 49eeab4848
commit 21dd61c597
3 changed files with 48 additions and 22 deletions

View File

@@ -7,7 +7,7 @@ export async function POST(request: NextRequest) {
// Check if there are any settings entries
const existingSettings = await prisma.settings.findFirst();
if (!existingSettings) {
return NextResponse.json({ "notification_text": "" });
return NextResponse.json({ "notification_text_application": "", "notification_text_server": "" });
}
// If settings entry exists, fetch it
@@ -15,10 +15,10 @@ export async function POST(request: NextRequest) {
where: { id: existingSettings.id },
});
if (!settings) {
return NextResponse.json({ "notification_text": "" });
return NextResponse.json({ "notification_text_application": "", "notification_text_server": "" });
}
// Return the settings entry
return NextResponse.json({ "notification_text": settings.notification_text });
return NextResponse.json({ "notification_text_application": settings.notification_text_application, "notification_text_server": settings.notification_text_server });
} catch (error: any) {
return NextResponse.json({ error: error.message }, { status: 500 });
}