7.6 익명/비밀댓글/비댓 해시 처리 o

This commit is contained in:
koreacomp5
2025-10-09 17:07:28 +09:00
parent 6d37881dd7
commit 15f30c1bc7
3 changed files with 16 additions and 3 deletions

View File

@@ -11,10 +11,19 @@ export async function GET(_: Request, context: { params: Promise<{ id: string }>
content: true,
isAnonymous: true,
isSecret: true,
secretPasswordHash: true,
createdAt: true,
},
});
return NextResponse.json({ comments });
const presented = comments.map((c) => ({
id: c.id,
content: c.isSecret ? "비밀댓글입니다." : c.content,
isAnonymous: c.isAnonymous,
isSecret: c.isSecret,
anonId: c.isAnonymous ? c.id.slice(-6) : undefined,
createdAt: c.createdAt,
}));
return NextResponse.json({ comments: presented });
}