Skip to content

Commit

Permalink
update pr with feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
pKorsholm committed Feb 22, 2023
1 parent 483b3a8 commit 4062974
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/medusa/src/services/product-variant-inventory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -660,13 +660,12 @@ class ProductVariantInventoryService extends TransactionBaseService {
variantInventoryItems: ProductVariantInventoryItem[],
channelId: string
): Promise<number> {
if (
variantInventoryItems.length &&
variantInventoryItems.some(
(inventoryItem) =>
inventoryItem.variant_id !== variantInventoryItems[0].variant_id
)
) {
const variantItemsAreMixed = variantInventoryItems.some(
(inventoryItem) =>
inventoryItem.variant_id !== variantInventoryItems[0].variant_id
)

if (variantInventoryItems.length && variantItemsAreMixed) {
throw new MedusaError(
MedusaError.Types.INVALID_DATA,
"All variant inventory items must belong to the same variant"
Expand Down

0 comments on commit 4062974

Please sign in to comment.