22 lines
469 B
TypeScript
22 lines
469 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" }, { createdAt: "asc" }],
|
||
|
|
select: {
|
||
|
|
id: true,
|
||
|
|
name: true,
|
||
|
|
slug: true,
|
||
|
|
description: true,
|
||
|
|
type: true,
|
||
|
|
requiresApproval: true,
|
||
|
|
allowAnonymousPost: true,
|
||
|
|
isAdultOnly: true,
|
||
|
|
},
|
||
|
|
});
|
||
|
|
return NextResponse.json({ boards });
|
||
|
|
}
|
||
|
|
|
||
|
|
|