import apiClient from "@/infrastructure/apiClient";
import apiPath from "@/infrastructure/apiPath";
export default {
  async tagSug(keyword) {
    var result = await apiClient
      .get(apiPath.tag.autocomplete + "?keyword=" + keyword)
      //.get("https://random-data-api.com/api/v2/users?size=10&is_xml=false")
      .then((r) => {
        return r.data;
      })
      .catch((e) => {
        console.log(e);
        return {};
      });
    return result;
  },
  async search(searchModel) {
    const params = JSON.parse(JSON.stringify(searchModel));

    var searchResult = await apiClient
      .post(apiPath.tag.search, params)
      .then((r) => {
        return r.data;
      })
      .catch((e) => {
        console.log(e);
        return {};
      });
    return searchResult;
  },
};
