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.
28 lines
532 B
28 lines
532 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,
|
|
}
|
|
|
|
export type Countries = Array<Country>
|
|
|
|
export const getCountries = (): Promise<Countries> => {
|
|
const config = {
|
|
body: {
|
|
params: {},
|
|
proc,
|
|
},
|
|
}
|
|
|
|
return callApi({
|
|
config,
|
|
url: DATA_URL,
|
|
}).then(getResponseData(proc))
|
|
}
|
|
|