diff --git a/app/page.tsx b/app/page.tsx index 7b41a0b..4069968 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -15,6 +15,11 @@ export default function Home() { const [submitted, setSubmitted] = useState(false); async function handleSubmit(e: any) { 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", { method: "POST", // specify the HTTP method headers: { "Content-Type": "application/json" }, // specify the content type