fix(core-flows): Lock cart on shipping update (#13535)

This commit is contained in:
Oli Juhl
2025-09-17 21:29:45 +02:00
committed by GitHub
parent c847f7d8bf
commit 76497fd40a
4 changed files with 49 additions and 34 deletions
@@ -1,3 +1,4 @@
import { addShippingMethodToCartWorkflow } from "@medusajs/core-flows"
import {
AdminInventoryItem,
AdminProduct,
@@ -242,15 +243,12 @@ export async function createOrderSeeder({
if (!withoutShipping) {
// Create shipping methods for each shipping option so shipping profiles of products in the cart are supported
await Promise.all(
shippingOptions.map(async (so) => {
await api.post(
`/store/carts/${cart.id}/shipping-methods`,
{ option_id: so.id },
storeHeaders
)
})
)
await addShippingMethodToCartWorkflow(container).run({
input: {
cart_id: cart.id,
options: shippingOptions.map((so) => ({ id: so.id })),
},
})
}
const paymentCollection = (