From 0d8b88d9a151805b4fc42247265e7bf1b9f8f370 Mon Sep 17 00:00:00 2001 From: Tola Leng Date: Fri, 23 May 2025 20:39:43 +0800 Subject: [PATCH] Updated Service Notification --- .../services/add-service/ServiceNotificationFields.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/application/src/components/services/add-service/ServiceNotificationFields.tsx b/application/src/components/services/add-service/ServiceNotificationFields.tsx index 7e3d719..0972b3a 100644 --- a/application/src/components/services/add-service/ServiceNotificationFields.tsx +++ b/application/src/components/services/add-service/ServiceNotificationFields.tsx @@ -39,10 +39,12 @@ export function ServiceNotificationFields({ form }: ServiceNotificationFieldsPro // Update alert configs when data is loaded useEffect(() => { if (alertConfigsData) { - setAlertConfigs(alertConfigsData); + // Only show enabled channels + const enabledChannels = alertConfigsData.filter(config => config.enabled); + setAlertConfigs(enabledChannels); // Debug log to check what alert configs are loaded - console.log("Loaded alert configurations:", alertConfigsData); + console.log("Loaded alert configurations:", enabledChannels); } }, [alertConfigsData]); @@ -136,4 +138,4 @@ export function ServiceNotificationFields({ form }: ServiceNotificationFieldsPro /> ); -} +} \ No newline at end of file