Skip to content

Commit

Permalink
Add 'home' property to BlurtingAnswerDto and
Browse files Browse the repository at this point in the history
update likes calculation
  • Loading branch information
overthestream committed Dec 19, 2023
1 parent cfe03ad commit 5de33de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dtos/blurtingPage.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export class BlurtingAnswerDto {
room: string,
user: UserEntity,
ilike: boolean = false,
home: boolean = false,
): BlurtingAnswerDto {
return {
id: answerEntity.id,
Expand All @@ -69,7 +70,7 @@ export class BlurtingAnswerDto {
postedAt: answerEntity.postedAt,
mbti: user?.userInfo?.mbti ?? null,
room: room ?? null,
likes: answerEntity.groupLikes,
likes: home ? answerEntity.allLikes : answerEntity.groupLikes,
ilike,
};
}
Expand Down
1 change: 1 addition & 0 deletions src/home/home.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export class HomeService {
null,
answerEntity.user,
iLike,
true,
),
};
}),
Expand Down

0 comments on commit 5de33de

Please sign in to comment.