9 lines
285 B
TypeScript
9 lines
285 B
TypeScript
// app/api/users/route.ts
|
|
import { NextResponse } from "next/server";
|
|
import { prisma } from "../../../lib/prisma";
|
|
|
|
export async function GET() {
|
|
const courses = await prisma.course.findMany({ select: { id: true, title: true, code: true } });
|
|
return NextResponse.json(courses);
|
|
}
|