Uncaught (in promise) TypeError: data.map is not a function
at VueComponent.module.exports (apply-filters.js?c856:4)
at VueComponent.boundFn [as applyFilters] (vue.runtime.esm.js?ff9b:164)
at VueComponent.module.exports (set-data.js?1d48:4)
at VueComponent.boundFn [as setData] (vue.runtime.esm.js?ff9b:164)
at VueComponent.eval (v-server-table.js?44f6:82)
at <anonymous>
<v-server-table url="/people"
:columns="columns"
:options="options">
Data table options:
options: {
requestFunction: (data) => {
let req = this.$auth.httpConfig();
req.url = "/people";
req.method = 'get';
req.data = {
params: data
};
return this.$http(req).catch(function(e) {
//this.dispatch('error', e);
});
}
}
Server response:
{"data":[{"first_name":"Ryan","last_name":"Chenkie","email":"[email protected]"},{"first_name":"Chris","last_name":"Sevilleja","email":"[email protected]"},{"first_name":"Holly","last_name":"Lloyd","email":"[email protected]"},{"first_name":"Adnan","last_name":"Kukic","email":"[email protected]"},{"first_name":"Leonel Adri\u00e1n","last_name":"Silva","email":null}],"count":5}
It seems that map function is called on the base object, it should be: data.data.map
Try the responseAdapter:
responseAdapter: function(resp) {
var d = resp.data;
return {
data: d.data,
count: d.count
}
}
Thanks that worked!
Thanks a lot! This issue is also solved to me!
Most helpful comment
Try the
responseAdapter: