comments implement
This commit is contained in:
1 parent
9e0bef2527
commit
4b6ecfbf5d
41 files changed
+1350
-13
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import { Comment } from '../../domain/entities/comment.entity.js';
|
||||
import { CommentDto } from '../dto/comment.dto.js';
|
||||
import { UserDto } from '../../../user/application/dto/user.dto.js';
|
||||
|
||||
export class CommentApplicationMapper {
|
||||
static toDto(comment: Comment, usersById: ReadonlyMap<string, UserDto>): CommentDto {
|
||||
return {
|
||||
id: comment.id as string,
|
||||
issueId: comment.issueId,
|
||||
authorId: comment.authorId,
|
||||
author: comment.authorId ? (usersById.get(comment.authorId) ?? null) : null,
|
||||
content: comment.isDeleted ? null : comment.content,
|
||||
editedAt: comment.editedAt,
|
||||
deletedAt: comment.deletedAt,
|
||||
createdAt: comment.createdAt,
|
||||
updatedAt: comment.updatedAt,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user