fix logo not updating
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user