Fix MLB standings 406 error and refactor ESPN adapter shared code #62

Merged
chrisp merged 3 commits from fix/mlb-standings-espn-refactor into main 2026-06-01 03:31:19 +00:00
3 changed files with 6 additions and 3 deletions
Showing only changes of commit 880b7faa6b - Show all commits

View file

@ -4,6 +4,7 @@ import {
parseConferenceRank,
sortByWinLoss,
statsMap,
type EspnStandingsResponse,
} from "./espn";
const MLB_STANDINGS_URL =
@ -30,7 +31,7 @@ export class MlbStandingsAdapter implements StandingsSyncAdapter {
throw new Error(`MLB standings API returned ${response.status}: ${response.statusText}`);
}
const json = await response.json();
const json = (await response.json()) as EspnStandingsResponse;
const flattened = flattenEspnStandings(json);
if (flattened.length === 0) {

View file

@ -3,6 +3,7 @@ import {
flattenEspnStandings,
parseConferenceRank,
statsMap,
type EspnStandingsResponse,
} from "./espn";
const MLS_STANDINGS_URL =
@ -28,7 +29,7 @@ export class MlsStandingsAdapter implements StandingsSyncAdapter {
);
}
const json = await response.json();
const json = (await response.json()) as EspnStandingsResponse;
const flattened = flattenEspnStandings(json);
if (flattened.length === 0) {

View file

@ -4,6 +4,7 @@ import {
parseConferenceRank,
sortByWinLoss,
statsMap,
type EspnStandingsResponse,
} from "./espn";
const NBA_STANDINGS_URL =
@ -16,7 +17,7 @@ export class NbaStandingsAdapter implements StandingsSyncAdapter {
throw new Error(`NBA standings API returned ${response.status}: ${response.statusText}`);
}
const json = await response.json();
const json = (await response.json()) as EspnStandingsResponse;
const flattened = flattenEspnStandings(json);
if (flattened.length === 0) {