stage 1
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
|
||||
// Public-by-design: returns the list of active operators so the login tile
|
||||
// grid can render. Contains no secrets (no email, no hashes).
|
||||
export async function GET() {
|
||||
const operators = await prisma.user.findMany({
|
||||
where: { role: "operator", active: true },
|
||||
select: { id: true, name: true },
|
||||
orderBy: { name: "asc" },
|
||||
});
|
||||
return NextResponse.json({ operators });
|
||||
}
|
||||
Reference in New Issue
Block a user