I am having some trouble getting the actual data out of the return from the api call. I can see the values output into the log, but when I try to access it using data[0].admin_url it returns undefined.
this.apiService
.getCCUrls()
.then(function(data){
console.log(data); //output in the image below
console.log(data[0].admin_url); //returns undefined
});
Which calls this:
APIService.prototype.getCCUrls = function() {
return this.makePublicApiRequest({
method: 'GET',
url: '/v1/cc-instances',
});
};
There is some simple utility code in between, but eventually it gets to this function...
APIService.prototype.makeRequest = function(config) {
return this.$http(config)
.then(function(response) {
// If we get a replacement token, update it.
this.authService.checkResponseHeaders(response);
var data = response.data;
if (data.data) {
return data.data;
}
if (data) {
return data;
}
return response;
}.bind(this));
};
Lastly, this is what is output in the console.log:
So, in my first set of code, how do I get to the admin_url, agent_url, or type variables?