several
This commit is contained in:
@@ -13,7 +13,9 @@ const useEnrollTeam = () => {
|
||||
if (!data) {
|
||||
toast.error('There was an issue enrolling. Please try again later.');
|
||||
} else {
|
||||
queryClient.invalidateQueries({ queryKey: ['tournaments', 'detail', tournamentId] });
|
||||
// Invalidate both tournament details and unenrolled teams queries
|
||||
queryClient.invalidateQueries({ queryKey: ['tournaments', 'details', tournamentId] });
|
||||
queryClient.invalidateQueries({ queryKey: ['tournaments', 'unenrolled', tournamentId] });
|
||||
toast.success('Team enrolled successfully!');
|
||||
}
|
||||
},
|
||||
|
||||
@@ -13,7 +13,9 @@ const useUnenrollTeam = () => {
|
||||
if (!data) {
|
||||
toast.error('There was an issue unenrolling. Please try again later.');
|
||||
} else {
|
||||
queryClient.invalidateQueries({ queryKey: ['tournaments', 'detail', tournamentId] });
|
||||
// Invalidate both tournament details and unenrolled teams queries
|
||||
queryClient.invalidateQueries({ queryKey: ['tournaments', 'details', tournamentId] });
|
||||
queryClient.invalidateQueries({ queryKey: ['tournaments', 'unenrolled', tournamentId] });
|
||||
toast.success('Team unenrolled successfully.');
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user