26 lines
542 B
TypeScript
26 lines
542 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,
|
||
|
|
},
|
||
|
|
});
|
||
|
|
return NextResponse.json({ boards });
|
||
|
|
}
|
||
|
|
|
||
|
|
|