style: flipping cards as background
This commit is contained in:
17
app/api/news/route.ts
Normal file
17
app/api/news/route.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import prisma from '../../../prisma/prisma';
|
||||
import { ApiResponse } from '../../../utils/apiResponse';
|
||||
|
||||
export async function GET() {
|
||||
const news = await prisma.news.findMany({
|
||||
orderBy: {
|
||||
createdAt: 'desc'
|
||||
},
|
||||
take: 50
|
||||
});
|
||||
|
||||
if (news && news.length === 50) {
|
||||
return ApiResponse(200, JSON.stringify(news));
|
||||
}
|
||||
|
||||
return ApiResponse(500, 'Internal server error');
|
||||
}
|
||||
Reference in New Issue
Block a user