import axios from 'axios';
import { API_PREF } from './common';

const fetchAllOrders = ({ session }) => {
  console.log({ session });

  return axios
    .get(`/api/order/list`, { headers: { session } })
    .then(function (response) {
      let { data } = response;

      let { orders } = data;

      return orders;
    })
    .catch(function (error) {
      // handle error
      console.log(error);
    });
};

export default fetchAllOrders;
