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

// Public: list affiliates.
export async function GET() {
  const affiliates = await prisma.affiliate.findMany({
    orderBy: [{ sortIndex: "asc" }, { createdAt: "asc" }],
  });
  return NextResponse.json(affiliates);
}
