0👍
Your issue is probably il the formData.append("products[]",prod)
method of your FormData
class, try changing formData.append("products[]",prod)
with formData.products.push(prod)
.
Furthermore in your axios call the payload should be formData.products if you API endpoint expects the products right?
Try axios.post(
${API_URL}/company/uploadProducts, formData.products, header)
.
I do not see any syntax issue relative to Vue, hope this helps. (And of course check what is sent by XHR in devtools as suggested in the comments)
Source:stackexchange.com