From 45d6444cdb7799c0657071c4c5a6f207283b4505 Mon Sep 17 00:00:00 2001 From: migbash <20924663+migbash@users.noreply.github.com> Date: Wed, 8 Mar 2023 06:31:10 +0000 Subject: [PATCH] fix: #1096 (leagues-table); --- src/lib/graphql/home/leagues_table/query.ts | 77 --------------------- src/lib/models/home/leagues_table/types.ts | 75 -------------------- 2 files changed, 152 deletions(-) delete mode 100644 src/lib/graphql/home/leagues_table/query.ts delete mode 100644 src/lib/models/home/leagues_table/types.ts diff --git a/src/lib/graphql/home/leagues_table/query.ts b/src/lib/graphql/home/leagues_table/query.ts deleted file mode 100644 index a1272479f..000000000 --- a/src/lib/graphql/home/leagues_table/query.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { gql } from 'graphql-request'; - -/** - * [ℹ] Surgical #1 (MAIN) - * [ℹ] standings query - */ -export const REDIS_CACHE_LEAGUES_TABLE_DATA_1 = gql` - query REDIS_CACHE_LEAGUES_TABLE_DATA_1 - @cached(ttl: 300) { - leagues_filtered_country { - lang - leagues - } - scores_standings_home_widget_translations { - games - lang - points - title - } - color_codes_league_standings_positions { - color_codes - sports - } - } -`; - -/** - * [ℹ] Surgical #2 (ALL) - * [ℹ] standings query - * [ℹ] Based on League ID - */ -export const REDIS_CACHE_LEAGUES_TABLE_DATA_2 = gql` - query REDIS_CACHE_LEAGUES_TABLE_DATA_2( - $leagueIds: [numeric!] - ) @cached(ttl: 300) { - scores_football_leagues( - where: { id: { _in: $leagueIds } } - ) { - # [ℹ] BY LEAGUE ID - country - data - name - id - season - seasons - } - scores_football_standings( - where: { id: { _in: $leagueIds } } - ) { - # [ℹ] BY LEAGUE ID - data - id - name - type - } - } -`; - -/** - * [ℹ] Surgical #1 (MAIN) - * [ℹ] standings query - * [ℹ] Based on Team ID - */ -export const REDIS_CACHE_LEAGUES_TABLE_DATA_3 = gql` - query REDIS_CACHE_LEAGUES_TABLE_DATA_3( - $teamIds: [numeric!] - ) @cached(ttl: 300) { - scores_football_teams( - where: { id: { _in: $teamIds } } - ) { - # [ℹ] BY TEAM ID - data - id - name - } - } -`; diff --git a/src/lib/models/home/leagues_table/types.ts b/src/lib/models/home/leagues_table/types.ts deleted file mode 100644 index 09f4e4dcf..000000000 --- a/src/lib/models/home/leagues_table/types.ts +++ /dev/null @@ -1,75 +0,0 @@ -import type { - BETARENA_HASURA_color_codes_league_standings_positions, - BETARENA_HASURA_leagues_filtered_country, - BETARENA_HASURA_scores_football_leagues, - BETARENA_HASURA_scores_football_standings, - BETARENA_HASURA_scores_football_teams, - BETARENA_HASURA_scores_standings_home_widget_translations -} from '../hasura'; - -/** - * ========================================== - * HASURA DB - COMPLETE WIDGET REQUIRED DATA - * ========================================== - */ - -export interface BETARENA_HASURA_standings_query { - leagues_filtered_country: BETARENA_HASURA_leagues_filtered_country[]; - color_codes_league_standings_positions: BETARENA_HASURA_color_codes_league_standings_positions[]; - scores_standings_home_widget_translations: BETARENA_HASURA_scores_standings_home_widget_translations[]; - - scores_football_leagues: BETARENA_HASURA_scores_football_leagues[]; - scores_football_standings: BETARENA_HASURA_scores_football_standings[]; - - scores_football_teams: BETARENA_HASURA_scores_football_teams[]; -} - -/** - * ========================================== - * CACHING PERSIST - COMPLETE WIDGET REQUIRED DATA - * ========================================== - */ - -export interface Cache_Single_Geo_Leagues_Table_Translation_Response { - lang: string; - top_leagues_table_data: Single_League_Table_Data[]; -} - -export interface Cache_Single_Lang_Leagues_Table_Translation_Response { - top_leagues_table_data: Single_League_Table_Data[]; - translations: Single_League_Table_Translations; -} - -export interface Leagues_Table_SEO_Cache_Ready { - top_leagues_table_data: Single_League_Table_Data[]; - translations: Single_League_Table_Translations[]; -} - -/** - * ========================================== - * OTHER CACHE INTERFACES - COMPLETE WIDGET REQUIRED DATA - * ========================================== - */ - -export interface Single_Team_Object_Data { - position: number; - team_logo: string; - team_name: string; - games_played: string; - points: string; - color_code: string; -} - -export interface Single_League_Table_Data { - season_league_id: string; - season_league_name: string; - season_league_logo: string; - season_league_teams: Array; -} - -export interface Single_League_Table_Translations { - lang: string; - games: string; - points: string; - title: string; -}