fix(medusa): getAvailableContext should first check if the inventory service is present (#4293)
* fix(medusa): getAvailableContext should first check if the inventory service is present * Create clever-seals-share.md
This commit is contained in:
committed by
GitHub
parent
2ebc3da98a
commit
2c0074031b
5
.changeset/clever-seals-share.md
Normal file
5
.changeset/clever-seals-share.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/medusa": patch
|
||||
---
|
||||
|
||||
fix(medusa): getAvailableContext should first check if the inventory service is present
|
||||
@@ -820,6 +820,10 @@ class ProductVariantInventoryService extends TransactionBaseService {
|
||||
products: (Product | PricedProduct)[],
|
||||
salesChannelId: string | string[] | undefined
|
||||
): Promise<(Product | PricedProduct)[]> {
|
||||
if (!this.inventoryService_) {
|
||||
return products
|
||||
}
|
||||
|
||||
const variantIds: string[] = products
|
||||
.flatMap((p) => p.variants.map((v: { id?: string }) => v.id) ?? [])
|
||||
.filter((v): v is string => !!v)
|
||||
|
||||
Reference in New Issue
Block a user