mirror of
https://github.com/SkalaraAI/waitlist.git
synced 2025-04-09 21:20:15 -04:00
can't be empty
This commit is contained in:
parent
2cb9783cca
commit
12ed50d96b
|
@ -15,6 +15,11 @@ export default function Home() {
|
||||||
const [submitted, setSubmitted] = useState(false);
|
const [submitted, setSubmitted] = useState(false);
|
||||||
async function handleSubmit(e: any) {
|
async function handleSubmit(e: any) {
|
||||||
e.preventDefault(); // prevent the default form submission behavior
|
e.preventDefault(); // prevent the default form submission behavior
|
||||||
|
if (!email) {
|
||||||
|
setAlertType("error");
|
||||||
|
setAlertMessage("Please enter an email.");
|
||||||
|
return;
|
||||||
|
} // if the email field is empty, do nothing
|
||||||
const res = await fetch("/api/waitlist", {
|
const res = await fetch("/api/waitlist", {
|
||||||
method: "POST", // specify the HTTP method
|
method: "POST", // specify the HTTP method
|
||||||
headers: { "Content-Type": "application/json" }, // specify the content type
|
headers: { "Content-Type": "application/json" }, // specify the content type
|
||||||
|
|
Loading…
Reference in New Issue
Block a user