import axios from "axios";
import { API_BASE_URL } from "@/config/const";

export type RefreshTokenRequestModel = {
  token: string;
};

export const refreshToken = async (model: RefreshTokenRequestModel) => {
  const res = await axios.post(
    `${API_BASE_URL}/public/auth/refresh`,
    { refreshToken: model.token },
    {
      headers: { "Content-Type": "application/json" },
    }
  );
  return res.data;
};
