fix logo not updating

This commit is contained in:
yohlo
2025-10-01 22:27:32 -05:00
parent 0910f11228
commit 03b2b54c1f
3 changed files with 24 additions and 12 deletions

View File

@@ -106,11 +106,6 @@ const TeamForm = ({
mutation(teamData, {
onSuccess: async (team: any) => {
queryClient.invalidateQueries({ queryKey: teamKeys.list });
queryClient.invalidateQueries({
queryKey: teamKeys.details(team.id),
});
if (logo && team) {
try {
let processedLogo = logo;
@@ -152,7 +147,12 @@ const TeamForm = ({
const result = await response.json();
console.log("Logo upload result:", result);
queryClient.invalidateQueries({ queryKey: teamKeys.list });
queryClient.invalidateQueries({
queryKey: teamKeys.details(team.id),
});
queryClient.setQueryData(
tournamentKeys.details(result.team!.id),
result.team
@@ -164,6 +164,11 @@ const TeamForm = ({
toast.error(logoErrorMessage);
logger.error("Team logo upload error", error);
}
} else {
queryClient.invalidateQueries({ queryKey: teamKeys.list });
queryClient.invalidateQueries({
queryKey: teamKeys.details(team.id),
});
}
if (team && team.id) {