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.
53 lines
933 B
53 lines
933 B
import {
|
|
DATA_URL,
|
|
PROCEDURES,
|
|
|
|
} from 'config'
|
|
import { callApi } from 'helpers'
|
|
|
|
const proc = PROCEDURES.get_player_info
|
|
|
|
export type PlayerProfile = {
|
|
c_gender: 1 | 2 | null,
|
|
club_team: {
|
|
id: number,
|
|
name_eng: string,
|
|
name_rus: string,
|
|
} | null,
|
|
country: {
|
|
id: number,
|
|
name_eng: string,
|
|
name_rus: string,
|
|
},
|
|
firstname_eng: string,
|
|
firstname_rus: string,
|
|
height: number | null,
|
|
id: number,
|
|
is_favorite: boolean,
|
|
is_gk: boolean | null,
|
|
lastname_eng: string,
|
|
lastname_rus: string,
|
|
nickname_eng: string | null,
|
|
nickname_rus: string | null,
|
|
weight: number | null,
|
|
} | null
|
|
|
|
export const getPlayerInfo = (
|
|
playerId: number,
|
|
sportType: number,
|
|
): Promise<PlayerProfile> => {
|
|
const config = {
|
|
body: {
|
|
params: {
|
|
_p_player_id: playerId,
|
|
_p_sport: sportType,
|
|
},
|
|
proc,
|
|
},
|
|
}
|
|
|
|
return callApi({
|
|
config,
|
|
url: DATA_URL,
|
|
})
|
|
}
|
|
|