File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { excludeFalsy } from '@/lib/arrays/excludeFalsy';
77import { pluralize } from '@/lib/pluralize' ;
88import { sleep } from '@/lib/sleep' ;
99import { getOperationsUrlForInstance } from '@/lib/urls/getOperationsUrlForInstance' ;
10+ import { useQueryClient } from '@tanstack/react-query' ;
1011import { useParams } from '@tanstack/react-router' ;
1112import { useCallback , useState } from 'react' ;
1213import { toast } from 'sonner' ;
@@ -22,6 +23,7 @@ interface RestartClusterClickResponse {
2223
2324export function useRestartClusterClick ( { onRestartedSuccessfully } : RestartClusterClickParams = { } ) : RestartClusterClickResponse {
2425 const { clusterId } : { clusterId ?: string ; } = useParams ( { strict : false } ) ;
26+ const queryClient = useQueryClient ( ) ;
2527 const [ isRestartPending , setIsRestartPending ] = useState ( false ) ;
2628 const onRestartClick = useCallback ( async ( ) => {
2729 if ( ! clusterId ) {
@@ -99,6 +101,7 @@ export function useRestartClusterClick({ onRestartedSuccessfully }: RestartClust
99101 }
100102
101103 setIsRestartPending ( false ) ;
104+ void queryClient . invalidateQueries ( { queryKey : [ clusterId ] } ) ;
102105
103106 if ( canceled ) {
104107 toast . error ( 'Cancelled' , {
You can’t perform that action at this time.
0 commit comments