Api post request - AxiosRespone mu have a Symbol.Iterator
Hi Lauris,
Metronic Vue 8.1.7
when using e.g. post request
const getUsers = () => {
ApiService.get("account/list")
.then((data) => {
tableData.value.splice(0, tableData.value.length, ...data);
})
.catch(({ response }) => {
console.log("API Request went wrong.");
});
};
I'm getting
Type 'AxiosResponse' must have a '[Symbol.iterator]()' method that returns an iterator.
How can I get rid off this error?
Replies (2)
I figured it out,
tableData.value.splice(0, tableData.value.length, ...data.data);
hmmm is there something changed .... on 8.1.4 this worked like
tableData.value.splice(0, tableData.value.length, ...data);
Hi Krystian,
Sorry for the late reply.
Glad to hear you have already figured this out. In Metronic 8.1.7 release we haven't modified ApiService.ts this might be related to your server response changes.
Regards,
Lauris Stepanovs,
Keenthemes Support Team