diff --git a/src/modules/classification/dto/classification.dto.ts b/src/modules/classification/dto/classification.dto.ts index 5c9ebb7..d747bbe 100644 --- a/src/modules/classification/dto/classification.dto.ts +++ b/src/modules/classification/dto/classification.dto.ts @@ -22,7 +22,7 @@ export interface PostListInClassificationFolder { createdAt: Date; - isRead: boolean; + readAt: Date; } export interface ClassificationPostList { @@ -40,7 +40,7 @@ export interface ClassificationPostList { createdAt: Date; - isRead: boolean; + readAt: Date; } export class UpdateAIClassificationDto { diff --git a/src/modules/posts/posts.repository.ts b/src/modules/posts/posts.repository.ts index 8867950..037c4ca 100644 --- a/src/modules/posts/posts.repository.ts +++ b/src/modules/posts/posts.repository.ts @@ -167,14 +167,8 @@ export class PostsRepository { url: 1, description: 1, createdAt: 1, - isRead: { - $cond: { - if: { $eq: ['$readAt', null] }, - then: false, - else: true, - }, - }, - keywords: '$aiClassification.keywords', + readAt: 1, + 'aiClassification.keywords': 1, }, }, ]) @@ -266,14 +260,8 @@ export class PostsRepository { url: 1, description: 1, createdAt: 1, - isRead: { - $cond: { - if: { $eq: ['$readAt', null] }, - then: false, - else: true, - }, - }, - keywords: '$aiClassification.keywords', + readAt: 1, + 'aiClassification.keywords': 1, }, }, ])