import {get, post} from '../request'; const prefix = 'list/' export const getCartListApi = async () => { return await get(`${prefix}list`) } export const getCartItemApi = async (id) => { return await get(`${prefix}detail`, {id}) } export const createCartApi = async (params) => { return await post(`${prefix}create`, params) } export const deleteCartApi = async (id) => { return await post(`${prefix}delete`, { ids: [id] }) } export const deleteCartItemApi = async (id) => { return await post(`${prefix}delete-item`, { ids: [id] }) } export const toCartApi = async (listId, productId) => { return await post(`${prefix}to-cart`, { list_id: listId, product_id: productId }) }