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;
|
let isSubmitted = false;
|
||||||
|
|
||||||
const handleSubmit = async (
|
const handleSubmit = async (
|
||||||
e: SubmitEvent & { currentTarget: EventTarget & HTMLFormElement }
|
e: SubmitEvent & {
|
||||||
|
currentTarget: EventTarget & HTMLFormElement;
|
||||||
|
target: EventTarget & HTMLFormElement;
|
||||||
|
}
|
||||||
) => {
|
) => {
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const data = new FormData(e.currentTarget!);
|
const data = new FormData(e.currentTarget!);
|
||||||
|
|
||||||
|
|
@ -18,6 +20,7 @@
|
||||||
|
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
isSubmitted = true;
|
isSubmitted = true;
|
||||||
|
e.target.reset();
|
||||||
} else {
|
} else {
|
||||||
alert('Something went wrong');
|
alert('Something went wrong');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue