enroll team polish?
This commit is contained in:
@@ -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();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user