This commit is contained in:
yohlo
2025-08-28 18:09:09 -05:00
parent 8eea99b125
commit 381ddc8f34
17 changed files with 343 additions and 98 deletions

View File

@@ -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!');
}
},

View File

@@ -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.');
}
},