Skip to content

Commit 65eb3aa

Browse files
chore(core-flows): use cart id when force_refresh is true (#11625)
1 parent 93cbc6b commit 65eb3aa

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

packages/core/core-flows/src/cart/workflows/refresh-cart-items.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,22 @@ export const refreshCartItemsWorkflow = createWorkflow(
148148
list: false,
149149
}).config({ name: "refetch–cart" })
150150

151+
const refreshCartInput = transform(
152+
{ refetchedCart, input },
153+
({ refetchedCart, input }) => {
154+
return {
155+
cart: !input.force_refresh ? refetchedCart : undefined,
156+
cart_id: !!input.force_refresh ? input.cart_id : undefined,
157+
}
158+
}
159+
)
160+
151161
refreshCartShippingMethodsWorkflow.runAsStep({
152-
input: { cart: refetchedCart },
162+
input: refreshCartInput,
153163
})
154164

155165
updateTaxLinesWorkflow.runAsStep({
156-
input: { cart: refetchedCart },
166+
input: refreshCartInput,
157167
})
158168

159169
const cartPromoCodes = transform(

0 commit comments

Comments
 (0)