Rename user.commentCount

This commit is contained in:
Toby Zerner 2018-08-24 21:33:18 +09:30
parent e253b79fe6
commit 14508d9fcc
3 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ Object.assign(User.prototype, {
newNotificationsCount: Model.attribute('newNotificationsCount'),
discussionCount: Model.attribute('discussionCount'),
commentsCount: Model.attribute('commentsCount'),
commentCount: Model.attribute('commentCount'),
canEdit: Model.attribute('canEdit'),
canDelete: Model.attribute('canDelete'),

View File

@ -131,7 +131,7 @@ export default class UserPage extends Page {
items.add('posts',
LinkButton.component({
href: app.route('user.posts', {username: user.username()}),
children: [app.translator.trans('core.forum.user.posts_link'), <span className="Button-badge">{user.commentsCount()}</span>],
children: [app.translator.trans('core.forum.user.posts_link'), <span className="Button-badge">{user.commentCount()}</span>],
icon: 'far fa-comment'
}),
100

View File

@ -43,7 +43,7 @@ class UserSerializer extends BasicUserSerializer
$attributes += [
'joinTime' => $this->formatDate($user->joined_at),
'discussionCount' => (int) $user->discussion_count,
'commentsCount' => (int) $user->comment_count,
'commentCount' => (int) $user->comment_count,
'canEdit' => $canEdit,
'canDelete' => $gate->allows('delete', $user),
];