first commit
This commit is contained in:
19
app/api/notice/item/route.ts
Normal file
19
app/api/notice/item/route.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { PrismaClient } from '../../../generated/prisma/client';
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
export async function GET() {
|
||||
const notices = await prisma.noticeBoard.findMany({
|
||||
where: {
|
||||
isDeleted: false,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
pubDate: true,
|
||||
tag: true,
|
||||
// 필요한 다른 필드들도 추가
|
||||
},
|
||||
});
|
||||
return Response.json(notices);
|
||||
}
|
||||
Reference in New Issue
Block a user