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

const GetOrderDetails = ({ cart, currency_code }) => {
  let session_raw = localStorage.getItem('session');
  let { session } = JSON.parse(session_raw);

  return axios
    .post(`/api/order/get-order-details`, { cart, currency_code }, { headers: { session } })
    .then(response => {
      return response['data'];
    })
    .catch(error => {
      console.error(error);
    });
};

export default GetOrderDetails;
