import Cookies from "js-cookie";

import { getAPI, postAPI, postAPIWithJson } from "../config/api";
import { getAPIDummy } from "./http-config/axiosCustom";

import {
  httpGetInterceptorWithToken,
  httpPostInterceptor,
} from "./http-config/http-interceptor-service";

export async function setLogin(data: any) {
  const pathUrl = "signin";
  return postAPI(pathUrl, data);
}

export async function getProfile(token: any) {
  const url = "users/info";
  return getAPI(url, token);
}

// export async function setLogin(data: any) {
//   const pathUrl = `signin`;
//   const headers = {
//     "content-type": "application/json",
//   };
//   return await httpPost(pathUrl, headers, data);
// }

export async function userInfo(token: any) {
  const pathUrl = `users/info`;
  return await httpGetInterceptorWithToken(pathUrl, token);
}
