- Changed
seasonβseasonCode(API usesseasonCode) - Changed
teamIdβplayerCodeorclubCode(API uses codes, not IDs) - Added
gameCodeandgameNumberparameters - Added
convertSeasonToCode()function to convert "2024-25" format to "E2024" format
Based on the Swagger spec schemas:
-
PlayerStats: Now matches
SeasonPlayerModelscore(points),assistances(assists),totalRebounds,valuation(PIR)clubCode,clubNameinstead of team objectblocksFavourinstead ofblocks
-
Game: Now matches
GameResultModelhomeTeam,awayTeamas strings (not objects)homeCode,awayCodefor team codesplayedboolean instead ofstatusstring
-
Team: Now matches
ClubModelcode,clubName,clubAliasinstead ofid,name,shortName
The API returns different structures:
/teamsβ{ clubs: [...] }/resultsβ{ gameResults: [...] }/standingsβ{ group: [{ team: [...] }] }(nested structure)/schedulesβ{ item: [...] }/playersβ Single object (not array) - handled by extracting from teams
Since /players endpoint returns a single player (requires playerCode), we now:
- Fetch all teams first
- Extract players from each team's
playersarray - Combine into a single list for display
- Added XML detection (API may return XML)
- Better error messages showing response structure
- Handles both JSON and XML content types
- Test
/teams?seasonCode=E2024- should return clubs array - Test
/results?seasonCode=E2024- should return gameResults array - Test
/standings?seasonCode=E2024- should return group array - Test
/schedules?seasonCode=E2024- should return item array - Test
/players?seasonCode=E2024&playerCode=XXX- should return single player
- Season dropdown converts "2024-25" to "E2024" correctly
- Teams load and display in filter dropdown
- Players list shows data from teams
- Games/Results display correctly
- Standings display correctly
- Schedules display correctly
- CSV export works
- Charts work for player comparison
- Error messages display when API fails
-
API Authentication: The Swagger spec shows OAuth2 required, but the API might work without it. If you get 401/403 errors, authentication may be needed.
-
XML Responses: The API may return XML by default. The code detects XML and shows an error. If JSON is available, we may need to add
Accept: application/jsonheader more explicitly. -
Players Endpoint: The
/playersendpoint requires aplayerCodeto get a specific player. We work around this by extracting players from teams. -
Season Format: The UI uses "2024-25" format but converts to "E2024" for the API. Make sure this conversion works for all seasons.
- Test the deployed app at: https://geordie--07e91f64f32d11f0ac1542dde27851f2.web.val.run
- Check browser console for any errors
- Verify API responses match expected structure
- If API requires authentication, we'll need to add OAuth2 support
- If API only returns XML, we may need to add XML parsing or find JSON endpoint