Skip to content

Commit

Permalink
issue: #1099;
Browse files Browse the repository at this point in the history
  • Loading branch information
migbash committed Mar 14, 2023
1 parent 8e666c5 commit c1b6fc4
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/routes/api/hasura/league/fixtures-odds/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,30 @@ async function main(
const target_current_season_arr = await get_league_current_seasons(LEAGUE_ID);
// [ℹ] exit
if (target_current_season_arr == undefined || target_current_season_arr.length == 0) {
return null;
// return null;
return {
league_id: LEAGUE_ID,
seasons: []
};
}
SEASON_ID = target_current_season_arr[0].id;
}
else {
SEASON_ID = parseInt(_seasonId);
}

console.log('SEASON_ID', SEASON_ID)

const h_fixtures_arr = await get_target_historic_fixtures(
graphQlInstance,
[SEASON_ID]
);
// [ℹ] exit;
if (h_fixtures_arr == undefined
|| h_fixtures_arr.length == 0) {
return null;
// return null;
return {
league_id: parseInt(_league_id),
seasons: []
};
}

const season_details_data = await get_target_season_details(
Expand Down Expand Up @@ -131,7 +137,11 @@ async function main(
);
// [ℹ] exit;
if (season_week_round_ranges_map == undefined) {
return null;
// return null;
return {
league_id: parseInt(_league_id),
seasons: []
};
}

let historic_fixtures_by_league = await fixturesGroupByLeague(
Expand Down

0 comments on commit c1b6fc4

Please sign in to comment.