add interactions to comments
This commit is contained in:
@@ -2,14 +2,18 @@ import prisma from '~/lib/prisma';
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const id = event.context.params?.id;
|
||||
console.log('prisma' + event.context.params?.id)
|
||||
|
||||
try {
|
||||
const article = await prisma.article.findUnique({ where: { id } });
|
||||
const article = await prisma.article.findUnique({
|
||||
where: { id },
|
||||
include: { comments: true },
|
||||
});
|
||||
|
||||
if (!article) {
|
||||
return {
|
||||
success: false,
|
||||
data: null,
|
||||
data: null,
|
||||
message: 'Article not found.',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user