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/getTeams.tsx

40 lines
675 B

import {
DATA_URL,
PROCEDURES,
} from 'config'
import { callApi } from 'helpers'
const proc = PROCEDURES.get_teams
export type Team = {
country: {
id: number,
name_eng: string,
name_rus: string,
},
header_image: string | null,
id: number,
is_favorite: boolean,
name_eng: string,
name_rus: string,
short_name_eng: string,
short_name_rus: string,
} | null
export const getTeams = (sportId: number, teams: Array<number>)
: Promise<Array<Team>> => {
const config = {
body: {
params: {
_p_sport_id: sportId,
_p_teams: teams,
},
proc,
},
}
return callApi({
config,
url: DATA_URL,
})
}