Merge branch 'develop' of https://github.com/medusajs/medusa into fix/wfe-context-ref (#12006)
This commit is contained in:
committed by
GitHub
parent
230cb84fa4
commit
1895d8cc11
5
.changeset/happy-baboons-cough.md
Normal file
5
.changeset/happy-baboons-cough.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/medusa": patch
|
||||
---
|
||||
|
||||
fix(medusa): skip index module when tags or categories present
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
MiddlewareRoute,
|
||||
} from "@medusajs/framework/http"
|
||||
import { isPresent, ProductStatus } from "@medusajs/framework/utils"
|
||||
import IndexEngineFeatureFlag from "../../../loaders/feature-flags/index-engine"
|
||||
import {
|
||||
filterByValidSalesChannels,
|
||||
normalizeDataForContext,
|
||||
@@ -19,7 +20,6 @@ import {
|
||||
} from "../../utils/middlewares"
|
||||
import * as QueryConfig from "./query-config"
|
||||
import { StoreGetProductsParams } from "./validators"
|
||||
import IndexEngineFeatureFlag from "../../../loaders/feature-flags/index-engine"
|
||||
|
||||
export const storeProductRoutesMiddlewares: MiddlewareRoute[] = [
|
||||
{
|
||||
@@ -35,7 +35,14 @@ export const storeProductRoutesMiddlewares: MiddlewareRoute[] = [
|
||||
),
|
||||
filterByValidSalesChannels(),
|
||||
(req, res, next) => {
|
||||
if (featureFlagRouter.isFeatureEnabled(IndexEngineFeatureFlag.key)) {
|
||||
const canUseIndex = !(
|
||||
isPresent(req.filterableFields.tags) ||
|
||||
isPresent(req.filterableFields.categories)
|
||||
)
|
||||
if (
|
||||
featureFlagRouter.isFeatureEnabled(IndexEngineFeatureFlag.key) &&
|
||||
canUseIndex
|
||||
) {
|
||||
return next()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user