Minor cleanup.
This commit is contained in:
parent
2bdd2c1c9d
commit
37366fcf69
1 changed files with 5 additions and 2 deletions
|
|
@ -5,9 +5,11 @@
|
|||
let isSubmitted = false;
|
||||
|
||||
const handleSubmit = async (
|
||||
e: SubmitEvent & { currentTarget: EventTarget & HTMLFormElement }
|
||||
e: SubmitEvent & {
|
||||
currentTarget: EventTarget & HTMLFormElement;
|
||||
target: EventTarget & HTMLFormElement;
|
||||
}
|
||||
) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
const data = new FormData(e.currentTarget!);
|
||||
|
||||
|
|
@ -18,6 +20,7 @@
|
|||
|
||||
if (res.ok) {
|
||||
isSubmitted = true;
|
||||
e.target.reset();
|
||||
} else {
|
||||
alert('Something went wrong');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue