import { useAdminsStore } from "@/stores/admins";
import axioss from "axios";

const baseURL = "https://dlearn-api.run.danakcorp.com";

const axios = axioss.create({ baseURL });

axios.interceptors.request.use((config) => {
  const admin = useAdminsStore();
  config.headers.Authorization = `Bearer ${admin.token}`;
  return config;
});

export default axios;
