28 lines
632 B
TypeScript
28 lines
632 B
TypeScript
import { NextResponse } from "next/server";
|
|
import prisma from "@/lib/prisma";
|
|
|
|
export async function GET() {
|
|
const boards = await prisma.board.findMany({
|
|
orderBy: { sortOrder: "asc" },
|
|
select: {
|
|
id: true,
|
|
name: true,
|
|
slug: true,
|
|
description: true,
|
|
sortOrder: true,
|
|
readLevel: true,
|
|
writeLevel: true,
|
|
allowAnonymousPost: true,
|
|
allowSecretComment: true,
|
|
requiresApproval: true,
|
|
type: true,
|
|
status: true,
|
|
categoryId: true,
|
|
category: { select: { id: true, name: true, slug: true } },
|
|
},
|
|
});
|
|
return NextResponse.json({ boards });
|
|
}
|
|
|
|
|