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

export interface PostGetSeries extends ResponseType {
  series: { id: number; name: string; icon: string }[];
  items: {
    id: number;
    series_id: number;
    name: string;
    region: number;
    pointJSON: any;
    polygonJSON: string;
    visited?: 0 | 1;
  }[];
}

export const seriesApi = {
  getSeries: (token: string | null, regions: string) =>
    request.postForm<PostGetSeries>(API.SERIES, { token, regions })
};
