import {
  DATA_URL,
  PROCEDURES,
} from 'config'
import { callApi } from 'helpers'

const proc = PROCEDURES.get_sport_list

export type Sport = {
  id: number,
  lexic: number,
  name_eng: string,
  name_rus: string,
}

export type SportList = Array<Sport>

export const getSportList = (): Promise<SportList> => {
  const config = {
    body: {
      params: {},
      proc,
    },
  }

  return callApi({
    config,
    url: DATA_URL,
  })
}
