Add new gallery variant

This commit is contained in:
2026-01-31 01:34:13 +01:00
parent 3ce4c9acfc
commit 88bb301e84
7 changed files with 328 additions and 21 deletions

View File

@ -0,0 +1,24 @@
"use server";
import { prisma } from "@/lib/prisma";
export type GalleryVariantStats = {
total: number;
withGallery: number;
missing: number;
};
export async function getGalleryVariantStats(): Promise<GalleryVariantStats> {
const [total, withGallery] = await Promise.all([
prisma.artwork.count(),
prisma.artwork.count({
where: { variants: { some: { type: "gallery" } } },
}),
]);
return {
total,
withGallery,
missing: total - withGallery,
};
}