devat-youtuber / mern-ecommerce

193 stars 128 forks source link

Unnecessary save pictures #10

Open nnguyen52 opened 3 years ago

nnguyen52 commented 3 years ago

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

devat-youtuber commented 2 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 } })

Altamash2002 commented 1 year ago

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/.