Skip to content

Commit

Permalink
refactor: isRead field to readAt
Browse files Browse the repository at this point in the history
  • Loading branch information
JonghunAn committed Jul 20, 2024
1 parent 7854bce commit 001b1aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/modules/classification/dto/classification.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface PostListInClassificationFolder {

createdAt: Date;

isRead: boolean;
readAt: Date;
}

export interface ClassificationPostList {
Expand All @@ -40,7 +40,7 @@ export interface ClassificationPostList {

createdAt: Date;

isRead: boolean;
readAt: Date;
}

export class UpdateAIClassificationDto {
Expand Down
20 changes: 4 additions & 16 deletions src/modules/posts/posts.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
])
Expand Down Expand Up @@ -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,
},
},
])
Expand Down

0 comments on commit 001b1aa

Please sign in to comment.