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

export interface PostGetKyeReturn extends ResponseType {
  max: number;
  regions: { qid: number; name: string }[];
  visited: number[];
}

export interface PostSetKyeReturn extends ResponseType {}

export const travelsApi = {
  getKye: (token: string) => request.postForm<PostGetKyeReturn>(API.GET_KYE, { token }),
  setKye: (token: string, qid: number, visited: 0 | 1) =>
    request.postForm<PostSetKyeReturn>(API.SET_KYE, { token, qid, visited })
};
