fix(core-flows): refresh payment collections upon shipping changes (#10673)
* fix(core-flows): refresh payment collections upon shipping changes * chore: fix spec
This commit is contained in:
@@ -17,8 +17,7 @@ import { validateAndReturnShippingMethodsDataStep } from "../steps/validate-ship
|
||||
import { validateCartShippingOptionsPriceStep } from "../steps/validate-shipping-options-price"
|
||||
import { cartFieldsForRefreshSteps } from "../utils/fields"
|
||||
import { listShippingOptionsForCartWithPricingWorkflow } from "./list-shipping-options-for-cart-with-pricing"
|
||||
import { updateCartPromotionsWorkflow } from "./update-cart-promotions"
|
||||
import { updateTaxLinesWorkflow } from "./update-tax-lines"
|
||||
import { refreshCartItemsWorkflow } from "./refresh-cart-items"
|
||||
|
||||
export interface AddShippingMethodToCartWorkflowInput {
|
||||
cart_id: string
|
||||
@@ -132,9 +131,9 @@ export const addShippingMethodToCartWorkflow = createWorkflow(
|
||||
}
|
||||
)
|
||||
|
||||
const currentShippingMethods = transform({ cart }, ({ cart }) => {
|
||||
return cart.shipping_methods.map((sm) => sm.id)
|
||||
})
|
||||
const currentShippingMethods = transform({ cart }, ({ cart }) =>
|
||||
cart.shipping_methods.map((sm) => sm.id)
|
||||
)
|
||||
|
||||
parallelize(
|
||||
removeShippingMethodFromCartStep({
|
||||
@@ -149,16 +148,8 @@ export const addShippingMethodToCartWorkflow = createWorkflow(
|
||||
})
|
||||
)
|
||||
|
||||
updateTaxLinesWorkflow.runAsStep({
|
||||
input: {
|
||||
cart_id: input.cart_id,
|
||||
},
|
||||
})
|
||||
|
||||
updateCartPromotionsWorkflow.runAsStep({
|
||||
input: {
|
||||
cart_id: input.cart_id,
|
||||
},
|
||||
refreshCartItemsWorkflow.runAsStep({
|
||||
input: { cart_id: cart.id },
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user