import { API_ROOT } from 'features/AuthServiceApp/config/routes'
import { callApi } from 'helpers'

export type GeoInfoType = {
  city: string,
  country_code: string,
  time_zone: string,
}

export const getGeoInfo = async (): Promise<GeoInfoType> => {
  const config = {
    method: 'GET',
  }

  return callApi({
    config,
    url: `${API_ROOT}/geoinfo`,
  })
}
