Files
msgapp/src/app/api/boards/route.ts

22 lines
469 B
TypeScript
Raw Normal View History

2025-10-09 11:23:27 +09:00
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 });
}