Ok so this is driving me crazy.
This is the end of my server side function. obj is an object already defined in the previous parts of my plugin
let asset_id = [];
let asset_type = [];
var response = [];
for (let i = 0; i < obj.resources.length; i++) {
let id = obj.resources[i].asset.id;
asset_id.push(id);
let type = obj.resources[i].asset.type;
asset_type.push(type);
response.push({
"_p_id" : id,
"_p_type": type})
}
console.log(response)
return { id: asset_id,type: asset_type, all: response};
My problem is on the “all” . The rest works just fine.
“all” returns null values within the array while the console.log(response) shows correctly the array in the logs. The count is correct though, so the array is being created, only for some reason the properties are empty
Here it is in the dev tools’ console
Here is what I get in the logs
Here is the definition of the values of the plugin
and here is the API response I’m using for “all”
Any ideas?