7.6 익명/비밀댓글/비댓 해시 처리 o
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user