enroll team polish?

This commit is contained in:
yohlo
2025-09-17 20:20:52 -05:00
parent cac42c9b29
commit 285a33c488
22 changed files with 411 additions and 124 deletions

View File

@@ -21,6 +21,7 @@ interface TeamFormProps {
initialValues?: Partial<TeamInput>;
teamId?: string;
tournamentId?: string;
onSubmit?: (teamId: string) => void;
}
const TeamForm = ({
@@ -28,6 +29,7 @@ const TeamForm = ({
initialValues,
teamId,
tournamentId,
onSubmit
}: TeamFormProps) => {
const isEditMode = !!teamId;
@@ -103,7 +105,13 @@ const TeamForm = ({
: "Failed to create team";
mutation(teamData, {
onSuccess: async (team) => {
onSuccess: async (team: any) => {
console.log(team)
queryClient.invalidateQueries({ queryKey: teamKeys.list });
queryClient.invalidateQueries({
queryKey: teamKeys.details(team.id),
});
if (logo && team) {
try {
const formData = new FormData();
@@ -122,10 +130,8 @@ const TeamForm = ({
const result = await response.json();
queryClient.invalidateQueries({ queryKey: teamKeys.list });
queryClient.invalidateQueries({
queryKey: teamKeys.details(result.team!.id),
});
console.log('here for some reason', result)
queryClient.setQueryData(
tournamentKeys.details(result.team!.id),
result.team
@@ -137,7 +143,10 @@ const TeamForm = ({
toast.error(logoErrorMessage);
logger.error("Team logo upload error", error);
}
} else {
}
if (team && team.id) {
onSubmit?.(team.id)
}
close();
},