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.
52 lines
900 B
52 lines
900 B
import {
|
|
DATA_URL,
|
|
PROCEDURES,
|
|
ProfileTypes,
|
|
} from 'config'
|
|
|
|
import { callApi } from 'helpers'
|
|
|
|
const proc = PROCEDURES.landing_get_match_info
|
|
|
|
type Team = {
|
|
name_eng: string,
|
|
name_rus: string,
|
|
}
|
|
|
|
export type UnauthenticatedMatch = {
|
|
date?: string,
|
|
live?: boolean,
|
|
team1?: Team,
|
|
team2?: Team,
|
|
tournament: {
|
|
name_eng: string,
|
|
name_rus: string,
|
|
},
|
|
} | null
|
|
|
|
export const getUnauthenticatedMatch = (
|
|
sportId: number,
|
|
matchId: number,
|
|
profileType?: ProfileTypes,
|
|
)
|
|
: Promise<UnauthenticatedMatch> => {
|
|
const config = {
|
|
body: {
|
|
params: {
|
|
_p_match_id: profileType === ProfileTypes.MATCHES
|
|
? matchId
|
|
: null,
|
|
_p_sport: sportId,
|
|
_p_tournament_id: profileType === ProfileTypes.TOURNAMENTS
|
|
? matchId
|
|
: null,
|
|
},
|
|
proc,
|
|
},
|
|
}
|
|
|
|
return callApi({
|
|
config,
|
|
url: DATA_URL,
|
|
})
|
|
}
|
|
|