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

export interface PostGetUniversalReturn extends ResponseType {
  users: {
    id: number;
    avatar: string | null;
    flag1: string;
    flag2: string | null;
    name: string;
  }[];
  regions: {
    id: number;
    name: string;
    flag1: string;
    flag2: string | null;
  }[];
  dare: {
    id: number;
    name: string;
    flag1: string;
    flag2: string | null;
  }[];
}

export const searchApi = {
  getUniversal: (search: string) =>
    request.postForm<PostGetUniversalReturn>(API.GET_UNIVERSAL, { search })
};
