New tournament/calendar form event report error instead of erroring out

This commit is contained in:
Kalle
2024-12-15 11:20:13 +02:00
parent d9c36e6221
commit 58dc9068da

View File

@@ -181,6 +181,12 @@ function EventForm() {
React.useState(false);
const handleSubmit = () => {
const isValid = ref.current?.checkValidity();
if (!isValid) {
ref.current?.reportValidity();
return;
}
const formData = new FormData(ref.current!);
// if "avatarImgId" it means they want to reuse an existing avatar