admin user and ui panel
This commit is contained in:
@@ -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 } },
|
||||
|
||||
Reference in New Issue
Block a user