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.
57 lines
1.1 KiB
57 lines
1.1 KiB
import {
|
|
DATA_URL,
|
|
PROCEDURES,
|
|
} from 'config'
|
|
import { callApi } from 'helpers'
|
|
|
|
const proc = PROCEDURES.get_user_info
|
|
|
|
export type TeamsAndTournaments = {
|
|
c_sport: number,
|
|
id: number,
|
|
name_eng: string,
|
|
name_rus: string,
|
|
}
|
|
|
|
export type UserInfo = {
|
|
address_line1: string | null,
|
|
address_line2: string | null,
|
|
city: string | null,
|
|
cityId: number | null,
|
|
country?: {
|
|
id: number,
|
|
name_eng: string,
|
|
name_rus: string,
|
|
},
|
|
download: {
|
|
id?: number,
|
|
teams: Array<TeamsAndTournaments> | null,
|
|
tournaments: Array<TeamsAndTournaments> | null,
|
|
},
|
|
email: string,
|
|
firstname: string | null,
|
|
has_subscription: boolean,
|
|
is_unsubscribed: boolean | null,
|
|
language: {
|
|
id: number | null,
|
|
iso: string | null,
|
|
name_en: string | null,
|
|
name_ru: string | null,
|
|
},
|
|
lastname: string | null,
|
|
password: string | null,
|
|
phone: string | null,
|
|
postal_code: number | null,
|
|
region: string | null,
|
|
}
|
|
|
|
export const getUserInfo = (): Promise<UserInfo> => {
|
|
const config = {
|
|
body: { params: {}, proc },
|
|
}
|
|
|
|
return callApi({
|
|
config,
|
|
url: DATA_URL,
|
|
})
|
|
}
|
|
|