diff --git a/framework/core/js/src/common/models/Discussion.js b/framework/core/js/src/common/models/Discussion.js index 21227ba68..54ce6f1ed 100644 --- a/framework/core/js/src/common/models/Discussion.js +++ b/framework/core/js/src/common/models/Discussion.js @@ -13,7 +13,7 @@ Object.assign(Discussion.prototype, { user: Model.hasOne('user'), firstPost: Model.hasOne('firstPost'), - lastTime: Model.attribute('lastTime', Model.transformDate), + lastPostedAt: Model.attribute('lastPostedAt', Model.transformDate), lastPostedUser: Model.hasOne('lastPostedUser'), lastPost: Model.hasOne('lastPost'), lastPostNumber: Model.attribute('lastPostNumber'), @@ -67,7 +67,7 @@ Object.assign(Discussion.prototype, { unreadCount() { const user = app.session.user; - if (user && user.readTime() < this.lastTime()) { + if (user && user.readTime() < this.lastPostedAt()) { return Math.max(0, this.lastPostNumber() - (this.readNumber() || 0)); } diff --git a/framework/core/js/src/forum/components/TerminalPost.js b/framework/core/js/src/forum/components/TerminalPost.js index 2fdb40bf4..c4c1b5bf7 100644 --- a/framework/core/js/src/forum/components/TerminalPost.js +++ b/framework/core/js/src/forum/components/TerminalPost.js @@ -16,7 +16,7 @@ export default class TerminalPost extends Component { const lastPost = this.props.lastPost && discussion.repliesCount(); const user = discussion[lastPost ? 'lastPostedUser' : 'user'](); - const time = discussion[lastPost ? 'lastTime' : 'createdAt'](); + const time = discussion[lastPost ? 'lastPostedAt' : 'createdAt'](); return ( diff --git a/framework/core/src/Api/Serializer/DiscussionSerializer.php b/framework/core/src/Api/Serializer/DiscussionSerializer.php index f971f4374..3a2395eee 100644 --- a/framework/core/src/Api/Serializer/DiscussionSerializer.php +++ b/framework/core/src/Api/Serializer/DiscussionSerializer.php @@ -40,7 +40,7 @@ class DiscussionSerializer extends BasicDiscussionSerializer 'commentCount' => (int) $discussion->comment_count, 'participantCount' => (int) $discussion->participant_count, 'createdAt' => $this->formatDate($discussion->created_at), - 'lastTime' => $this->formatDate($discussion->last_posted_at), + 'lastPostedAt' => $this->formatDate($discussion->last_posted_at), 'lastPostNumber' => (int) $discussion->last_post_number, 'canReply' => $gate->allows('reply', $discussion), 'canRename' => $gate->allows('rename', $discussion),