|
|
|
|
@ -5,7 +5,23 @@ import { MatchStatuses } from 'features/HeaderFilters' |
|
|
|
|
|
|
|
|
|
const proc = PROCEDURES.get_matches |
|
|
|
|
|
|
|
|
|
export type Item = { |
|
|
|
|
export type Data = { |
|
|
|
|
is_video_sections: boolean, |
|
|
|
|
video_content: VideoContent, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export type VideoContent = { |
|
|
|
|
broadcast: Items, |
|
|
|
|
features: Items, |
|
|
|
|
highlights: Items, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export type Items = { |
|
|
|
|
content: Array<Content> | null, |
|
|
|
|
name: string, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export type Content = { |
|
|
|
|
id: number, |
|
|
|
|
matches: Array<Match>, |
|
|
|
|
name_eng: string, |
|
|
|
|
@ -36,12 +52,12 @@ type Args = { |
|
|
|
|
tournamentId: number, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const getMatches = ({ |
|
|
|
|
export const getMatches = async ({ |
|
|
|
|
date, |
|
|
|
|
matchStatus, |
|
|
|
|
sportType, |
|
|
|
|
tournamentId, |
|
|
|
|
}: Args): Promise<Array<Item>> => { |
|
|
|
|
}: Args) => { |
|
|
|
|
const config = { |
|
|
|
|
body: { |
|
|
|
|
params: { |
|
|
|
|
@ -54,8 +70,10 @@ export const getMatches = ({ |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return callApi({ |
|
|
|
|
const data: Data = await callApi({ |
|
|
|
|
config, |
|
|
|
|
url: DATA_URL, |
|
|
|
|
}).then(getResponseData(proc)) |
|
|
|
|
|
|
|
|
|
return data.video_content.broadcast.content || [] |
|
|
|
|
} |
|
|
|
|
|