diff --git a/src/requests/getMatches/getHomeMatches.tsx b/src/requests/getMatches/getHomeMatches.tsx index 7dcc530d..f76c9aad 100644 --- a/src/requests/getMatches/getHomeMatches.tsx +++ b/src/requests/getMatches/getHomeMatches.tsx @@ -1,4 +1,4 @@ -import { PROCEDURES } from 'config' +import { PROCEDURES, API_ROOT } from 'config' import { client } from 'config/clients' @@ -21,6 +21,8 @@ export const getHomeMatches = async ({ offset, timezoneOffset, }: Args): Promise => { + const url = `${API_ROOT}/v1/data/get-matches` + const config = { body: { _p_date: `${date} 00:00:00`, @@ -31,5 +33,5 @@ export const getHomeMatches = async ({ }, } - return requestMatches(config).then(getMatchesPreviews) + return requestMatches(config, url).then(getMatchesPreviews) } diff --git a/src/requests/getMatches/request.tsx b/src/requests/getMatches/request.tsx index 0a953fde..3e302720 100644 --- a/src/requests/getMatches/request.tsx +++ b/src/requests/getMatches/request.tsx @@ -1,4 +1,4 @@ -import { API_ROOT } from 'config' +import { DATA_URL } from 'config' import { callApi } from 'helpers' import type { MatchesResponse, MatchesBySection } from './types' @@ -9,14 +9,14 @@ type Config = { }, } -export const requestMatches = async (config: Config): Promise => { +export const requestMatches = async (config: Config, url?: string): Promise => { const { is_video_sections, show, video_content: data, }: MatchesResponse = await callApi({ config, - url: `${API_ROOT}/v1/data/get-matches`, + url: url || DATA_URL, }) return {