File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export const useLikeToggle = () => {
3838 queryClient . invalidateQueries ( {
3939 queryKey : capsuleQueryKeys . detail ( id ) ,
4040 } ) ,
41- queryClient . invalidateQueries ( { queryKey : capsuleQueryKeys . my ( ) } ) ,
41+ queryClient . invalidateQueries ( { queryKey : [ "capsule" , "my" ] } ) ,
4242 ] ) ;
4343 } ,
4444 } ) ;
@@ -50,8 +50,13 @@ export const useLeaveCapsule = () => {
5050 mutationFn : ( id : string ) => {
5151 return apiClient . delete ( ENDPOINTS . LEAVE_CAPSULE ( id ) ) ;
5252 } ,
53- onSuccess : ( ) => {
54- queryClient . invalidateQueries ( { queryKey : capsuleQueryKeys . my ( ) } ) ;
53+ onSuccess : async ( _data , id : string ) => {
54+ await Promise . all ( [
55+ queryClient . invalidateQueries ( { queryKey : [ "capsule" , "my" ] } ) ,
56+ queryClient . invalidateQueries ( {
57+ queryKey : capsuleQueryKeys . detail ( id ) ,
58+ } ) ,
59+ ] ) ;
5560 } ,
5661 } ) ;
5762} ;
You can’t perform that action at this time.
0 commit comments