import React, { useEffect } from 'react'
import Head from "next/head"
export default function submit() {
const handleForm = async event => {
event.preventDefault()
const res = await fetch('http://localhost:4000/api/bot/submitted', {
body: JSON.stringify({
...
}),
headers: {
'Content-Type': 'application/json'
},
method: 'POST'
})
const result = await res.json()
}
return (
<div>
<form onSubmit={ handleForm }>
...
</form>
</div>
)
}
i checked my backend but it didnt send the request to the backend, when i submit my form it says "failed to fetch"