feat: add repeat daily reminder functionality with UI updates and translations

This commit is contained in:
Daniel Volz
2025-12-25 12:29:42 +01:00
parent 3d5526875c
commit 06da1d6eb8
5 changed files with 35 additions and 6 deletions
+9 -1
View File
@@ -149,12 +149,20 @@ export async function settingsRoutes(app: FastifyInstance) {
app.put<{ Body: SettingsBody }>("/settings", async (request, reply) => {
const body = request.body;
// Check if any stock reminders are configured
const hasEmailStock = body.emailEnabled && body.emailStockReminders && body.notificationEmail;
const hasShoutrrrStock = body.shoutrrrEnabled && body.shoutrrrStockReminders && body.shoutrrrUrl;
const hasAnyStockReminder = hasEmailStock || hasShoutrrrStock;
// Disable repeatDailyReminders if no stock reminders are configured
const repeatDailyReminders = hasAnyStockReminder ? (body.repeatDailyReminders ?? false) : false;
// Save notification settings to JSON file
saveNotificationSettings({
emailEnabled: body.emailEnabled,
notificationEmail: body.notificationEmail,
reminderDaysBefore: body.reminderDaysBefore,
repeatDailyReminders: body.repeatDailyReminders ?? false,
repeatDailyReminders,
lowStockDays: body.lowStockDays ?? 30,
normalStockDays: body.normalStockDays ?? 90,
highStockDays: body.highStockDays ?? 180,