import { request } from '../../../utils';
import { API } from '../../../types';
import { ResponseType } from '../response-type';

export interface PostGetVisitedIds extends ResponseType {
  ids: number[];
}

export const mapsApi = {
  getVisitedRegionsIds: (token: string, type: 'in' | 'by', year: number, uid: number) =>
    request.postForm<PostGetVisitedIds>(API.GET_VISITED_REGIONS_IDS, { token, type, year, uid }),
  getVisitedCountriesIds: (token: string, type: 'in' | 'by', year: number, uid: number) =>
    request.postForm<PostGetVisitedIds>(API.GET_VISITED_COUNTRIES_IDS, { token, type, year, uid }),
  getVisitedDareIds: (token: string, uid: number) =>
    request.postForm<PostGetVisitedIds>(API.GET_VISITED_DARE_IDS, { token, uid }),
  getVisitedSeriesIds: (token: string) =>
    request.postForm<PostGetVisitedIds>(API.GET_VISITED_SERIES_IDS, { token })
};
