text: import axios from 'axios';
  
  const API = axios.create({ baseURL: 'https://trackerica.herokuapp.com' });
  
  API.interceptors.request.use((req) => {
    if (localStorage.getItem('profile')) {
      req.headers.Authorization = `Bearer ${
        JSON.parse(localStorage.getItem('profile')).token
      }`;
    }
  
    return req;
  });
  
  export const fetchExercises = () => API.get('/exercises');
  export const createExercise = (newExercise) =>
    API.post('/exercises', newExercise);
  export const updateExercise = (id, updatedExercise) =>
    API.patch(`/exercises/${id}`, updatedExercise);
  export const deleteExercise = (id) => API.delete(`/exercises/${id}`);
  
  export const signIn = (formData) => API.post('/user/signin', formData);
  export const signUp = (formData) => API.post('/user/signup', formData);
  