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

// Public: list work experience, most recent first.
export async function GET() {
  const experience = await prisma.workExperience.findMany({
    orderBy: [{ sortIndex: "asc" }, { fromDate: "desc" }],
  });
  return NextResponse.json(experience);
}
