diff --git a/src/components/EditTournamentForm.tsx b/src/components/EditTournamentForm.tsx index 1641eae..6852922 100644 --- a/src/components/EditTournamentForm.tsx +++ b/src/components/EditTournamentForm.tsx @@ -19,16 +19,19 @@ export default function EditTournamentForm({ tournament }: EditTournamentFormPro format: tournament.format, status: tournament.status, maxParticipants: tournament.maxParticipants?.toString() || "", + targetScore: tournament.targetScore?.toString() || "", + allowTies: tournament.allowTies || false, }) const [error, setError] = useState("") const [success, setSuccess] = useState("") const [isLoading, setIsLoading] = useState(false) const handleChange = (e: React.ChangeEvent) => { - const { name, value } = e.target + const { name, value, type } = e.target + const checked = (e.target as HTMLInputElement).checked setFormData(prev => ({ ...prev, - [name]: value, + [name]: type === 'checkbox' ? checked : value, })) } @@ -48,6 +51,7 @@ export default function EditTournamentForm({ tournament }: EditTournamentFormPro ...formData, maxParticipants: formData.maxParticipants ? parseInt(formData.maxParticipants) : null, eventDate: formData.eventDate ? new Date(formData.eventDate).toISOString() : null, + targetScore: formData.targetScore ? parseInt(formData.targetScore) : null, }), }) @@ -186,19 +190,50 @@ export default function EditTournamentForm({ tournament }: EditTournamentFormPro +
+
+ + +
+ +
+ + +
+
+
-