File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/pages/Settings/notifications Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 11import NotificationTabsLinks from "@flanksource-ui/components/Notifications/NotificationTabsLinks" ;
22import NotificationSilenceForm from "@flanksource-ui/components/Notifications/SilenceNotificationForm/NotificationSilenceForm" ;
3+ import { useQueryClient } from "@tanstack/react-query" ;
34import { useNavigate } from "react-router-dom" ;
45
56export default function NotificationSilencedAddPage ( ) {
67 const navigate = useNavigate ( ) ;
8+ const client = useQueryClient ( ) ;
79
810 return (
911 < NotificationTabsLinks activeTab = { "Silences" } isAddSilence >
1012 < div className = "mx-auto flex h-full max-w-screen-md flex-1 flex-col px-6 py-6 pb-0" >
1113 < h3 className = "px-4 text-xl font-semibold" > Silence Notification</ h3 >
1214 < NotificationSilenceForm
13- onSuccess = { ( ) => navigate ( "/notifications/silences" ) }
15+ onSuccess = { ( ) => {
16+ navigate ( "/notifications/silences" ) ;
17+ client . invalidateQueries ( {
18+ queryKey : [ "notification_silences" ]
19+ } ) ;
20+
21+ client . refetchQueries ( {
22+ queryKey : [ "notification_silences" ]
23+ } ) ;
24+ } }
1425 />
1526 </ div >
1627 </ NotificationTabsLinks >
You can’t perform that action at this time.
0 commit comments