Skip to content

Commit

Permalink
chore(core-flows): use cart id when force_refresh is true (#11625)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-r-l-rodrigues authored Feb 26, 2025
1 parent 93cbc6b commit 65eb3aa
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/core/core-flows/src/cart/workflows/refresh-cart-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,22 @@ export const refreshCartItemsWorkflow = createWorkflow(
list: false,
}).config({ name: "refetch–cart" })

const refreshCartInput = transform(
{ refetchedCart, input },
({ refetchedCart, input }) => {
return {
cart: !input.force_refresh ? refetchedCart : undefined,
cart_id: !!input.force_refresh ? input.cart_id : undefined,
}
}
)

refreshCartShippingMethodsWorkflow.runAsStep({
input: { cart: refetchedCart },
input: refreshCartInput,
})

updateTaxLinesWorkflow.runAsStep({
input: { cart: refetchedCart },
input: refreshCartInput,
})

const cartPromoCodes = transform(
Expand Down

0 comments on commit 65eb3aa

Please sign in to comment.