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

41 lines
727 B

import { API_ROOT } from 'config'
import { callApi } from 'helpers'
export type FavouriteTeamType = {
country_id?: number,
season: number,
sport_id: number,
tournament_id: number,
}
export type FavouriteTeams = {
active?: boolean,
group?: string,
id: number,
name_en: string,
name_ru: string,
}
export type ResponseType = {
data: {
data: Array<FavouriteTeams>,
} | null,
msg: string,
status: string,
}
export const getFavouriteTeam = async ({
season,
sport_id,
tournament_id,
}: FavouriteTeamType): Promise<ResponseType> => {
const config = {
method: 'GET',
}
return callApi({
config,
url: `${API_ROOT}/v1/survey/teams/${sport_id}/${tournament_id}/${season}`,
})
}