add interactions to comments
This commit is contained in:
@@ -2,12 +2,14 @@ import prisma from '~/lib/prisma';
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
try {
|
||||
const articles = await prisma.article.findMany();
|
||||
const articles = await prisma.article.findMany({
|
||||
include: { comments: true },
|
||||
});
|
||||
|
||||
if (!articles || articles.length === 0) {
|
||||
return {
|
||||
success: false,
|
||||
data: null,
|
||||
data: null,
|
||||
message: 'No articles found.',
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user