contacts
kroy963@gmail.com
+91 7797566023
@kroy665
@koushik-roy
contact form
code
12345678910111213141516171819202122
const form = {
    name: "",
    email: "",
    message: ""
} 

const handleSubmit = async (e: React.FormEvent) => {
    e.preventDefault();
    if (!form.name || !form.email || !form.message) {
        console.log("Please fill all the fields");
        return;
    }
    const response = await fetch("/api/contact", {
        method: "POST",
        headers: {
            "Content-Type": "application/json",
        },
        body: JSON.stringify(form),
    });
    const data = await response.json();
    console.log(data);
}
$

No output yet. Run your code to see results.