fix: enforce 1 shipping method per profile (#322)
prevents the scenario where multiple concurrent calls to insert a shipping method may lead to an inconsistent cart state with more than 1 shipping method per profile.
This commit is contained in:
@@ -100,6 +100,17 @@ module.exports = async (connection, data = {}) => {
|
||||
data: {},
|
||||
});
|
||||
|
||||
await manager.insert(ShippingOption, {
|
||||
id: "test-option-2",
|
||||
name: "test-option-2",
|
||||
provider_id: "test-ful",
|
||||
region_id: "test-region",
|
||||
profile_id: defaultProfile.id,
|
||||
price_type: "flat_rate",
|
||||
amount: 500,
|
||||
data: {},
|
||||
});
|
||||
|
||||
const cart = manager.create(Cart, {
|
||||
id: "test-cart",
|
||||
customer_id: "some-customer",
|
||||
|
||||
Reference in New Issue
Block a user