admin user and ui panel

This commit is contained in:
s.esmaeili
2026-09-21 08:32:31 +03:30
parent 79226c9f13
commit ef1d4638cc
341 changed files with 2270 additions and 657 deletions
@@ -9,8 +9,18 @@ export class CatalogService {
return this.prisma.product.findMany({
where: { isActive: true },
include: {
variants: true,
images: true,
// Only orderable variants reach the storefront. An inactive one used to
// be listed and then rejected by getVariantOrThrow at checkout, so the
// customer could pick a chip and get a 404 on the order.
variants: {
where: { isActive: true },
// Each variant carries its own gallery picture, so the app can render
// the chip without a second request per variant.
include: { image: true },
},
// Explicit order: the UI treats images[0] as the product's main photo,
// which is only meaningful if the rows come back sorted.
images: { orderBy: { sortOrder: 'asc' } },
category: true,
brand: true,
collections: { include: { collection: true } },