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.
 
 
 
 
spa_instat_tv/src/requests/getMatches/getHomeMatches.tsx

36 lines
689 B

import { PROCEDURES, API_ROOT } from 'config'
import { client } from 'config/clients'
import type { MatchesBySection } from './types'
import { requestMatches } from './request'
const proc = PROCEDURES.get_matches
type Args = {
date: string,
limit: number,
offset: number,
timezoneOffset: number,
}
export const getHomeMatches = async ({
date,
limit,
offset,
timezoneOffset,
}: Args): Promise<MatchesBySection> => {
const url = `${API_ROOT}/v1/data/matches/query`
const config = {
body: {
date: `${date} 00:00:00`,
gmt: timezoneOffset,
limit,
offset,
...client.requests?.[proc],
},
}
return requestMatches(config, url)
}