13 lines
337 B
TypeScript
13 lines
337 B
TypeScript
import { NextResponse } from "next/server";
|
|
import { prisma } from "@/lib/prisma";
|
|
|
|
export async function GET() {
|
|
try {
|
|
const slots = await prisma.classSlot.findMany({
|
|
orderBy: { label: "asc" },
|
|
});
|
|
return NextResponse.json(slots);
|
|
} catch {
|
|
return NextResponse.json({ error: "Erreur" }, { status: 500 });
|
|
}
|
|
} |