this is the error
the form is not updating in the DB. It is showing this bellow error
const handleAddItem = (event) => {
event.preventDefault();
const productName = productNameRef.current.value;
const price = priceRef.current.value;
const description = descriptionRef.current.value;
const quantity = quantityRef.current.value;
const img = imgRef.current.value;
// console.log(productName, price, description, quantity, img);
const url = `http://localhost:5000/item`;
fetch(url, {
method: 'POST',
headers: {
'content-type': 'application/json'
},
body: JSON.stringify(event)
})
.then(res=> res.json())
.then(result =>{
console.log(result);
})
}
Here is the code part the handles the submission of the form. and the form is a basic HTML form. This code shows the above mention error snipit that includes the error. Please need some help to solve this. Thank you..