fix(#2628): change route for getmatches and fix requestmatches

keep-around/c565ff1b550717786d8ee4b348e0fa82262be550^2
Andrei Dekterev 3 years ago
parent b47aef897a
commit 711e2b8d65
  1. 6
      src/requests/getMatches/getHomeMatches.tsx
  2. 6
      src/requests/getMatches/request.tsx

@ -1,4 +1,4 @@
import { PROCEDURES } from 'config' import { PROCEDURES, API_ROOT } from 'config'
import { client } from 'config/clients' import { client } from 'config/clients'
@ -21,6 +21,8 @@ export const getHomeMatches = async ({
offset, offset,
timezoneOffset, timezoneOffset,
}: Args): Promise<MatchesBySection> => { }: Args): Promise<MatchesBySection> => {
const url = `${API_ROOT}/v1/data/get-matches`
const config = { const config = {
body: { body: {
_p_date: `${date} 00:00:00`, _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)
} }

@ -1,4 +1,4 @@
import { API_ROOT } from 'config' import { DATA_URL } from 'config'
import { callApi } from 'helpers' import { callApi } from 'helpers'
import type { MatchesResponse, MatchesBySection } from './types' import type { MatchesResponse, MatchesBySection } from './types'
@ -9,14 +9,14 @@ type Config = {
}, },
} }
export const requestMatches = async (config: Config): Promise<MatchesBySection> => { export const requestMatches = async (config: Config, url?: string): Promise<MatchesBySection> => {
const { const {
is_video_sections, is_video_sections,
show, show,
video_content: data, video_content: data,
}: MatchesResponse = await callApi({ }: MatchesResponse = await callApi({
config, config,
url: `${API_ROOT}/v1/data/get-matches`, url: url || DATA_URL,
}) })
return { return {

Loading…
Cancel
Save