From 711e2b8d650240687e883ede0cae3235cdddb50b Mon Sep 17 00:00:00 2001 From: Andrei Dekterev Date: Tue, 9 Aug 2022 12:50:49 +0400 Subject: [PATCH] fix(#2628): change route for getmatches and fix requestmatches --- src/requests/getMatches/getHomeMatches.tsx | 6 ++++-- src/requests/getMatches/request.tsx | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) 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 {