Code looks like this
async function getPlayerInfo(playerId) {
let info = [];
await axios.get(`https://api.battlemetrics.com/players/${playerId}`).then(res => {
var attributes = res.data.data.attributes;
let data = {
Name: attributes.name,
Private: attributes.private,
PossitiveMatch: attributes.positiveMatch,
CreatedAt: attributes.createdAt,
UpdatedAt: attributes.updatedAt
}
info.push(data);
})
return servers;
}
seems that info was meant to be returned but a non-existent 'servers' is being returned causing an error whenever the function is called