From 14508d9fcc88a34b02b4dee98de425efb3d8aa2f Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 24 Aug 2018 21:33:18 +0930 Subject: [PATCH] Rename user.commentCount --- framework/core/js/src/common/models/User.js | 2 +- framework/core/js/src/forum/components/UserPage.js | 2 +- framework/core/src/Api/Serializer/UserSerializer.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/core/js/src/common/models/User.js b/framework/core/js/src/common/models/User.js index e0c55fcf7..f49512ffc 100644 --- a/framework/core/js/src/common/models/User.js +++ b/framework/core/js/src/common/models/User.js @@ -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'), diff --git a/framework/core/js/src/forum/components/UserPage.js b/framework/core/js/src/forum/components/UserPage.js index 4d036dca7..67c27fb01 100644 --- a/framework/core/js/src/forum/components/UserPage.js +++ b/framework/core/js/src/forum/components/UserPage.js @@ -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'), {user.commentsCount()}], + children: [app.translator.trans('core.forum.user.posts_link'), {user.commentCount()}], icon: 'far fa-comment' }), 100 diff --git a/framework/core/src/Api/Serializer/UserSerializer.php b/framework/core/src/Api/Serializer/UserSerializer.php index 02d760ada..94103106e 100644 --- a/framework/core/src/Api/Serializer/UserSerializer.php +++ b/framework/core/src/Api/Serializer/UserSerializer.php @@ -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), ];