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

29 lines
561 B

import { DATA_URL, PROCEDURES } from 'config'
import { callApi, getResponseData } from 'helpers'
const proc = PROCEDURES.lst_c_country
export type Country = {
id: number,
iso_3166_1_alpha_2: string,
iso_3166_1_alpha_3: string,
name_eng: string,
name_rus: string,
phone_code: string | null,
}
export type Countries = Array<Country>
export const getCountries = (): Promise<Countries> => {
const config = {
body: {
params: {},
proc,
},
}
return callApi({
config,
url: DATA_URL,
}).then(getResponseData(proc))
}