Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Team information has last season's names #227

Closed
Seth-Duncan opened this issue Sep 13, 2023 · 4 comments · Fixed by #229
Closed

Team information has last season's names #227

Seth-Duncan opened this issue Sep 13, 2023 · 4 comments · Fixed by #229

Comments

@Seth-Duncan
Copy link

Not sure what I'm doing wrong here but I'm calling the API and getting last season's team names. Is there some sort of caching issue? I get updated team abbreviations, but not team names.

I build a teamLookup to use in other areas of the app:

espnClient.getTeamsAtWeek({ seasonId: DEFAULT_SEASON_ID, scoringPeriodId: scoringPeriod }).then( response => {
            const teamLookupMap  = response.reduce((lookup, team) => ({ ...lookup, [team.id]: {
                id: team.id,
                abbreviation: team.abbreviation,
                name: team.name,
                logo: team.logoURL,
                wins: team.wins,
                losses: team.losses,
                divisionId: getTeamDivisionId(team.id)
            }}), {});
            resolve(teamLookupMap);
        }).catch(error => {
            console.log({error});
            reject('ERROR');
        });

DEFAULT_SEASON_ID = 2023
scoringPeriodId = 1

@thomandretti
Copy link

thomandretti commented Sep 14, 2023

I'm seeing this as well. I think ESPN may have changed their data model. If I just hit this endpoint directly with CURL:

https://fantasy.espn.com/apis/v3/games/ffl/seasons/2023/segments/0/leagues/88811253?scoringPeriodId=0&view=mRoster&view=mTeam

I see that there are fields called location and nickname that have last year's info, and a field called name that has the new info. Haven't confirmed but I am guessing the library is just concatenating the location and nickname fields to populate name.

@thomandretti
Copy link

@Seth-Duncan
Copy link
Author

yeah looks to be the case

https://github.com/mkreiser/ESPN-Fantasy-Football-API/blob/main/src/team/team.js#L88

Thanks for this.

@mkreiser
Copy link
Owner

Fixed in #229

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants