Files
outline/server/presenters/comment.ts
2024-07-02 03:55:16 -07:00

19 lines
579 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,
};
}