Skip to content

Commit 335dc6a

Browse files
committed
Comment mapper function fix
1 parent 8e24511 commit 335dc6a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

frontend/src/components/view/tweet/Comment.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<span class="icon is-medium has-text-info">
2626
<font-awesome-icon icon="heart" />
2727
</span>
28-
{{ comment.likesCount || 0 }}
28+
{{ comment.likesCount }}
2929
</a>
3030
</div>
3131
</nav>

frontend/src/services/Normalizer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ export const commentMapper = comment => ({
1313
authorId: comment.author_id,
1414
created: comment.created_at,
1515
updated: comment.updated_at,
16-
author: userMapper(comment.author)
16+
author: userMapper(comment.author),
17+
// @todo fix backend api
18+
likesCount: comment.likes_count || 0
1719
});
1820

1921
export const tweetMapper = tweet => ({

0 commit comments

Comments
 (0)