Skip to content

Commit

Permalink
✨ remove cart item
Browse files Browse the repository at this point in the history
  • Loading branch information
DuvCharles committed Nov 28, 2023
1 parent 26eeb39 commit 1b28806
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/sylius/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ export const addToCart = async (cartId: string | undefined, payload: AddToCartPa
quantity: payload[0]?.quantity
});
};
export const removeFromCart = () => {};
export const removeFromCart = async (cartId: string, itemIds: string[]) => {
await syliusRequest(REST_METHODS.DELETE, `/orders/${cartId}/items/${itemIds[0]}`);
};

export const updateCart = async (cartId: string, payload: UpdateCartPayload[]) => {
await syliusRequest(
Expand Down

0 comments on commit 1b28806

Please sign in to comment.