You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
625 B
29 lines
625 B
import { DATA_URL } from 'config'
|
|
import { callApi } from 'helpers'
|
|
|
|
import type { MatchesResponse, MatchesBySection } from './types'
|
|
|
|
type Config = {
|
|
body: {
|
|
proc: string,
|
|
},
|
|
}
|
|
|
|
export const requestMatches = async (config: Config): Promise<MatchesBySection> => {
|
|
const {
|
|
is_video_sections,
|
|
show,
|
|
video_content: data,
|
|
}: MatchesResponse = await callApi({
|
|
config,
|
|
url: DATA_URL,
|
|
})
|
|
|
|
return {
|
|
broadcast: data.broadcast || [],
|
|
features: data.features || [],
|
|
hasNextPage: Boolean(show),
|
|
highlights: data.highlights || [],
|
|
isVideoSections: Boolean(is_video_sections),
|
|
}
|
|
}
|
|
|