Team information has last season's names
Seth-Duncan opened this issue · 4 comments
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
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
.
yeah looks to be the case
https://github.com/mkreiser/ESPN-Fantasy-Football-API/blob/main/src/team/team.js#L88
yeah looks to be the case
https://github.com/mkreiser/ESPN-Fantasy-Football-API/blob/main/src/team/team.js#L88
Thanks for this.