Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions packages/medusa/src/api/store/products/middlewares.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const storeProductRoutesMiddlewares: MiddlewareRoute[] = [
delete filters.category_id

if (!isPresent(categoryIds)) {
return
return { is_internal: false, is_active: true }
}

return { id: categoryIds, is_internal: false, is_active: true }
Expand Down Expand Up @@ -92,13 +92,7 @@ export const storeProductRoutesMiddlewares: MiddlewareRoute[] = [
}),
applyDefaultFilters({
status: ProductStatus.PUBLISHED,
categories: (_filters, fields: string[]) => {
if (!fields.some((field) => field.startsWith("categories"))) {
return
}

return { is_internal: false, is_active: true }
},
categories: { is_internal: false, is_active: true } // Always apply this filter

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The store/product/[id]/route.ts calls refetch but this filter should propagate

}),
normalizeDataForContext(),
setPricingContext(),
Expand Down
Loading