API
The @hv/cart
package contains an /api
folder that exports code
to stand-up Next.js Route Handlers.
These endpoints each correspond to a React hook from the @hv/cart/client
export, and use the
Cart
integration function as the underlying implementation.
Together these are useful for fetching and mutating data in client components.
Endpoint | Hook |
---|---|
removeFromCart | useRemoveFromCart |
removePromoCode | useRemovePromoCode |
updateLineItem | useUpdateLineItem |
placeOrder | usePlaceOrder |
getProduct | useProduct |
getPaymentMethods | usePaymentMethods |
addPromoCode | useAddPromoCode |
updateCart | useUpdateCart |
getCart | useCart |
getOrder | useOrder |
addToCart | useAddToCart |