import { fetchJSON } from '../../utils/fetchJSON'; import { API_BASE_URI } from '../apiBaseUrl'; const OUT_SERVICE_BASE_URL = `${API_BASE_URI}/outservice`; export interface Region { id?: number; code?: string; name?: string; slug?: string; localities?: string[]; } const EMPTY_REGIONS: Region[] = []; export async function getOutServiceRegions(): Promise { const data = await fetchJSON(`${OUT_SERVICE_BASE_URL}/outserviceregions`); return data && Array.isArray(data) ? data : EMPTY_REGIONS; }