feat(medusa): Prevent default SC to be assign if the isolated product flag is enabled (#5037)
* feat(medusa): Prevent default SC to be assign if the isolated product flag is enabled * Create breezy-fans-accept.md
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/medusa": patch
|
||||
---
|
||||
|
||||
feat(medusa): Prevent default SC to be assigned if the isolated product flag is enabled
|
||||
@@ -3,6 +3,7 @@ import { NextFunction, Request, Response } from "express"
|
||||
import { FlagRouter } from "@medusajs/utils"
|
||||
import SalesChannelFeatureFlag from "../../loaders/feature-flags/sales-channels"
|
||||
import { SalesChannelService } from "../../services"
|
||||
import IsolateProductDomain from "../../loaders/feature-flags/isolate-product-domain"
|
||||
|
||||
/**
|
||||
* Middleware that includes the default sales channel on the request, if no sales channels present
|
||||
@@ -23,6 +24,8 @@ export function withDefaultSalesChannel(
|
||||
|
||||
if (
|
||||
!featureFlagRouter.isFeatureEnabled(SalesChannelFeatureFlag.key) ||
|
||||
// Do not attach the default SC if the isolate product domain feature flag is enabled
|
||||
featureFlagRouter.isFeatureEnabled(IsolateProductDomain.key) ||
|
||||
req.query.sales_channel_id?.length ||
|
||||
req.get("x-publishable-api-key")
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user