mirror of
https://github.com/outline/outline.git
synced 2026-11-21 13:34:02 +03:00
20 lines
619 B
TypeScript
20 lines
619 B
TypeScript
import { Comment } from "@server/models";
|
|
import presentUser from "./user";
|
|
|
|
export default function present(comment: Comment) {
|
|
return {
|
|
id: comment.id,
|
|
data: comment.data,
|
|
documentId: comment.documentId,
|
|
parentCommentId: comment.parentCommentId,
|
|
createdBy: presentUser(comment.createdBy),
|
|
createdById: comment.createdById,
|
|
resolvedAt: comment.resolvedAt,
|
|
resolvedBy: comment.resolvedBy ? presentUser(comment.resolvedBy) : null,
|
|
resolvedById: comment.resolvedById,
|
|
createdAt: comment.createdAt,
|
|
updatedAt: comment.updatedAt,
|
|
reactions: comment.reactions ?? [],
|
|
};
|
|
}
|