스키마 작업완료
This commit is contained in:
21
src/app/api/boards/route.ts
Normal file
21
src/app/api/boards/route.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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 });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user