From b2269187d815f7e367f2a41af38cd84b95beaa58 Mon Sep 17 00:00:00 2001 From: Tola Leng Date: Wed, 3 Sep 2025 21:48:59 +0700 Subject: [PATCH] feat: Add channel_id field for Notifiarr - Add channel_id field for Notifiarr to store record of the discord channel_id into the PB. --- .../NotificationChannelDialog.tsx | 51 +++++++++++++------ .../src/services/alertConfigService.ts | 1 + 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/application/src/components/settings/notification-settings/NotificationChannelDialog.tsx b/application/src/components/settings/notification-settings/NotificationChannelDialog.tsx index d96622d..abee15a 100644 --- a/application/src/components/settings/notification-settings/NotificationChannelDialog.tsx +++ b/application/src/components/settings/notification-settings/NotificationChannelDialog.tsx @@ -92,6 +92,7 @@ const pushoverSchema = baseSchema.extend({ const notifiarrSchema = baseSchema.extend({ notification_type: z.literal("notifiarr"), api_token: z.string().min(1, "API token is required"), + channel_id: z.string().min(1, "Channel ID is required"), }); const webhookSchema = baseSchema.extend({ @@ -635,22 +636,40 @@ export const NotificationChannelDialog = ({ )} {notificationType === "notifiarr" && ( - ( - - API Token - - - - - Your Notifiarr API token for sending notifications - - - - )} - /> + <> + ( + + API Token + + + + + Your Notifiarr API token for sending notifications + + + + )} + /> + ( + + Channel ID + + + + + The Discord channel ID where notifications will be sent + + + + )} + /> + )} {notificationType === "webhook" && ( diff --git a/application/src/services/alertConfigService.ts b/application/src/services/alertConfigService.ts index 1147614..97329ae 100644 --- a/application/src/services/alertConfigService.ts +++ b/application/src/services/alertConfigService.ts @@ -94,6 +94,7 @@ export const alertConfigService = { } else if (config.notification_type === "notifiarr") { cleanConfig.api_token = config.api_token || ""; + cleanConfig.channel_id = config.channel_id || ""; } else if (config.notification_type === "webhook") { cleanConfig.webhook_url = config.webhook_url || "";