This commit is contained in:
Your Name committed 2026-09-23 06:57:13 +07:00
1 parent c2269ea090
commit 14d3282a81
8 files changed
+226 -39

No files matched your search

+4 -3
View File
@@ -1242,7 +1242,7 @@ async function resolveProductsForSection(payload: any, lang: string) {
if (payload.type === "featured") {
products = await prisma.product.findMany({
where: { categoryId: Number(payload.categoryId) || 1 },
where: { categoryId: Number(payload.categoryId) || 1, isDeleted: false },
include: productInclude,
take: limit,
});
@@ -1251,7 +1251,7 @@ async function resolveProductsForSection(payload: any, lang: string) {
(payload.scentId || payload.brandId)
) {
products = await prisma.product.findMany({
where: { brandId: Number(payload.brandId || payload.scentId) },
where: { brandId: Number(payload.brandId || payload.scentId), isDeleted: false },
include: productInclude,
take: limit,
});
@@ -1259,13 +1259,14 @@ async function resolveProductsForSection(payload: any, lang: string) {
const ids = payload.productIds.map(Number);
if (ids.length > 0) {
products = await prisma.product.findMany({
where: { id: { in: ids } },
where: { id: { in: ids }, isDeleted: false },
include: productInclude,
});
products.sort((a, b) => ids.indexOf(a.id) - ids.indexOf(b.id));
}
} else {
products = await prisma.product.findMany({
where: { isDeleted: false },
include: productInclude,
take: limit,
});