Open nnguyen52 opened 3 years ago
If people get image upload error, quit axios
and use fetch
:
const res = await fetch('/api/upload', { method: "POST", body: formData, headers: { Authorization: token } })
fetch is also not working I am getting this error Proxy error: Could not proxy request /api/upload from localhost:3000 to http://localhost:5000/.
When in creating product peocess. => if you choose an image file. It get instantly saved in cloudinary, which is not good because if admin may not want to create product anymore => the image still get saved to database. It should be creatting image as placehoder => when aubmit form create product=> save image to database