let formData = new FormData();
payloadData = JSON.stringify(payload.unitDoctors);
for (var prop in payloadData) {
formData.append(prop, payloadData[prop]);
}
axios({
method: "put",
url: apiUrl + payload.id,
data: formData
})
.then(response => {
commit("updateRecord", response.data);
})
.catch(error => {
commit("setErrors", error.response.data);
});
}
Why does the api controller always receive null for unitDoctors(array) when FormData is sent? Any solutions?