export default function PageWithJSbasedForm() { const handleSubmit = async (event) => { event.preventDefault() const data = { "status":"published", name: event.target.schoolName.value, country: event.target.country.value, } const JSONdata = JSON.stringify(data) const endpoint = 'https://management.beanstalkedu.com/items/school' const options = { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSONdata, } const response = await fetch(endpoint, options) const result = await response.json() alert(`Is this your full name: ${result.data}`) } return (
) }