Fix: Update products/[slug]/page to use showAsReadyMade
Changed related products query to filter by showAsReadyMade instead of deleted showOnProducts column on the Product model. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Haiku 4.5
parent
aa092f80a0
commit
f2aed12fb6
@@ -14,7 +14,7 @@ export default async function StandardProductPage({ params }: { params: { slug:
|
|||||||
const product = toProductDTO(row, activePromotions, 'plain');
|
const product = toProductDTO(row, activePromotions, 'plain');
|
||||||
|
|
||||||
const relatedRows = await prisma.product.findMany({
|
const relatedRows = await prisma.product.findMany({
|
||||||
where: { category: product.category, showOnProducts: true, NOT: { id: product.id } },
|
where: { category: product.category, showAsReadyMade: true, NOT: { id: product.id } },
|
||||||
take: 4,
|
take: 4,
|
||||||
});
|
});
|
||||||
const related = relatedRows.map((p) => toProductDTO(p, activePromotions, 'plain'));
|
const related = relatedRows.map((p) => toProductDTO(p, activePromotions, 'plain'));
|
||||||
|
|||||||
Reference in New Issue
Block a user