import request from '../../src/js/request'
import { _STORE } from '../base-api'
import { config } from '../index.js'
const { cartBaseUrl } = config

// 获取购物车所有餐品
export const fhGetCartAll = memberId =>
  request({
    url: `${cartBaseUrl}/${memberId}/cart/all`
  })

// 清空购物车所有餐品
export const fhDeleteCartAll = memberId =>
  request({
    url: `${cartBaseUrl}/${memberId}/cart/all`,
    method: "delete"
  })

// 获取购物车对应日期餐次的餐品
export const fhGetCart = (memberId, params) =>
  request({
    url: `${cartBaseUrl}/${memberId}/cart`,
    params
  })

// 清空购物车对应日期餐次的餐品
export const fhDeleteCart = (memberId, params) =>
  request({
    url: `${cartBaseUrl}/${memberId}/cart`,
    method: "delete",
    params
  })

// 保存购物车餐品
export const fhSaveCart = (memberId, data, params) =>
  request({
    url: `${cartBaseUrl}/${memberId}/cart`,
    method: 'post',
    data,
    params
  })
