Skip to content

returning servers that do not exist in getServerPlayerInfo() #1

@blaw6331

Description

@blaw6331

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions