import {
  API_ROOT,
} from 'config'
import { callApi } from 'helpers'

export type UsaStateType = {
  id: number,
  iso_2: string,
  name_eng: string,
  name_rus: string,
}

export const getUsaStates = (): Promise<Array<UsaStateType>> => {
  const config = {
    method: 'GET',
  }

  return callApi({
    config,
    url: `${API_ROOT}/v1/data/usa-states`,
  })
}
