MCPcopy Create free account
hub / github.com/vercel/examples / removeFromCart

Function removeFromCart

flags-sdk/flagsmith/lib/actions.ts:34–42  ·  view source on GitHub ↗
(item: CartItem)

Source from the content-addressed store, hash-verified

32}
33
34export async function removeFromCart(item: CartItem) {
35 const cartId = await getCartId()
36 await fetch(`${BACKEND_URL}/api/cart/${cartId.value}`, {
37 method: 'DELETE',
38 headers: { 'Content-Type': 'application/json' },
39 body: JSON.stringify(item),
40 })
41 revalidatePath('/cart')
42}

Callers 1

ShoppingCartRemoveButtonFunction · 0.90

Calls 1

fetchFunction · 0.85

Tested by

no test coverage detected