import axios from "../../../axios";

export function fetchCartList(id: string | null) {
  const data = id ? { anonymous_id: id } : "";
  return axios.post(`/orders/cart/`, data);

  // const response = axios.post(`/orders/cart/`);
  // return response;
}
export function addOrUpdateCart(payload: any) {
  let response = axios.post(`/orders/cart/add-or-update/`, payload);

  return response;
}

export function removeItemFromCart(payload: any) {
  const response = axios.delete(`/orders/cart/remove/${payload}/`);
  return response;
}

export const doCartFlush = (payload: any) => {
  const response = axios.post(`/orders/cart/flush/`, payload);
  return response;
};
