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.
39 lines
703 B
39 lines
703 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: Array<FavouriteTeams>,
|
|
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}`,
|
|
})
|
|
}
|
|
|