import { NextResponse } from "next/server";
import { prisma } from "@/lib/prisma";

/** Données vitrine uniquement (pas de métadonnées internes). */
export async function GET() {
  const rows = await prisma.galleryImage.findMany({
    orderBy: [{ sortOrder: "asc" }, { createdAt: "asc" }],
    select: {
      id: true,
      imageUrl: true,
      alt: true,
      sortOrder: true,
    },
  });
  return NextResponse.json(rows);
}
