Skip to content

Commit

Permalink
Merge pull request #535 from commercelayer/feat/add-to-cart-hook
Browse files Browse the repository at this point in the history
Add `_update_quantity` to addToCart function
  • Loading branch information
acasazza authored Jun 19, 2024
2 parents 84411f7 + c116c90 commit 30a245a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/react-components/src/reducers/OrderReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ export interface CustomLineItem {
metadata?: Record<string, string>
frequency?: LooseAutocomplete<TFrequency>
externalPrice?: boolean
_update_quantity?: boolean
}

export type AddToCartParams = Partial<{
Expand Down Expand Up @@ -460,7 +461,7 @@ export async function addToCart(
name,
image_url: imageUrl,
quantity: quantity ?? 1,
_update_quantity: true,
_update_quantity: lineItem?._update_quantity ?? true,
bundle_code: bundleCode,
metadata,
frequency: frequency as string
Expand Down

0 comments on commit 30a245a

Please sign in to comment.