text: import axios from "axios";
  import logger from "./logService";
  import { toast } from "react-toastify";
  
  axios.defaults.baseURL = process.env.REACT_APP_API_URL;
  
  axios.interceptors.response.use(null, (error) => {
    console.log("hier intercept");
  
    const expectedError =
      error.response &&
      error.response.status >= 404 &&
      error.response.status < 500;
  
    if (!expectedError) {
      logger.log(error);
      toast.error("An unexpected error occurrred.");
    }
  
    return Promise.reject(error);
  });
  
  function setJwt(jwt) {
    axios.defaults.headers.common["x-auth-token"] = jwt;
  }
  
  export default {
    get: axios.get,
    post: axios.post,
    put: axios.put,
    delete: axios.delete,
    setJwt,
  };
  