Skip to content

Commit

Permalink
fix: #1009;
Browse files Browse the repository at this point in the history
  • Loading branch information
migbash committed Feb 16, 2023
1 parent 7e877c3 commit 6f58d97
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 19 deletions.
25 changes: 8 additions & 17 deletions src/lib/components/fixtures_page/standings/Standings-Widget.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,19 @@
// COMPONENT METHODS
// ~~~~~~~~~~~~~~~~~~~~~
// [ℹ] MAIN
// [ℹ] [NaN]
async function widgetInit(): Promise<void> {
// [ℹ] data validation check
if (STANDINGS_DATA == undefined) {
const valdiation =
STANDINGS_DATA?.comp_typ != 'domestic'
|| STANDINGS_DATA == undefined
// [ℹ] validation [1]
if (valdiation) {
dlog(`${STANDINGS_FW_DEBUG_TAG} ❌ no data available!`, STANDINGS_FW_DEBUG_TOGGLE, STANDINGS_FW_DEBUG_STYLE);
no_widget_data = true;
return;
}
// [ℹ] otherwise, no data
else {
no_widget_data = false;
}
// loaded = true;
// STANDINGS_T.data.sportbook_detail = response
// [ℹ] order dates by descending order;
// STANDINGS_T.data.seasons.sort((a, b) => parseFloat(b.name.toString().slice(-2)) - parseFloat(a.name.toString().slice(-2)));
// [ℹ] select same-seaon-as-league-info-widget;
// dropdownSeasonSelect = STANDINGS_T.data.seasons[0]
no_widget_data = false;
STANDINGS_T = STANDINGS_T;
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/models/hasura.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export interface BETARENA_HASURA_scores_football_standings {
league_id?: number;
data?: StandingsHistDatum[];
name?: string;
type?: string;
type?: ScoresTournamentsType;
season_id?: number;
multipart?: boolean;
}
Expand All @@ -105,7 +105,7 @@ export interface BETARENA_HASURA_scores_football_standings_history {
league_id?: number;
data?: StandingsHistDatum[];
name?: string;
type?: string;
type?: ScoresTournamentsType;
season_id?: number;
multipart?: boolean;
}
Expand Down
2 changes: 2 additions & 0 deletions src/lib/models/tournaments/standings/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type {
BETARENA_HASURA_scores_team_statistics,
BETARENA_HASURA_scores_team_statistics_history,
BETARENA_HASURA_scores_widget_standings_translations,
ScoresTournamentsType,
WidgetsNoDataAvailable
} from '../../../../lib/models/hasura.js';

Expand Down Expand Up @@ -64,6 +65,7 @@ export interface REDIS_CACHE_SINGLE_tournament_standings_data {
url?: string;
league_id?: number;
seasons?: Tournament_Standing_Season[];
comp_typ?: ScoresTournamentsType
}

/**
Expand Down

0 comments on commit 6f58d97

Please sign in to comment.