From dd65801d57776e8784263d14426b647e8411dcfb Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 24 Aug 2018 21:27:50 +0930 Subject: [PATCH] Rename post.hideTime --- js/src/common/models/Post.js | 4 ++-- js/src/forum/utils/PostControls.js | 4 ++-- src/Api/Serializer/PostSerializer.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/src/common/models/Post.js b/js/src/common/models/Post.js index a720ed3a9..b9c1127c3 100644 --- a/js/src/common/models/Post.js +++ b/js/src/common/models/Post.js @@ -19,9 +19,9 @@ Object.assign(Post.prototype, { editUser: Model.hasOne('editUser'), isEdited: computed('editedAt', editedAt => !!editedAt), - hideTime: Model.attribute('hideTime', Model.transformDate), + hiddenAt: Model.attribute('hiddenAt', Model.transformDate), hideUser: Model.hasOne('hideUser'), - isHidden: computed('hideTime', hideTime => !!hideTime), + isHidden: computed('hiddenAt', hiddenAt => !!hiddenAt), canEdit: Model.attribute('canEdit'), canHide: Model.attribute('canHide'), diff --git a/js/src/forum/utils/PostControls.js b/js/src/forum/utils/PostControls.js index 6140b96b8..d90528898 100644 --- a/js/src/forum/utils/PostControls.js +++ b/js/src/forum/utils/PostControls.js @@ -123,7 +123,7 @@ export default { * @return {Promise} */ hideAction() { - this.pushAttributes({ hideTime: new Date(), hideUser: app.session.user }); + this.pushAttributes({ hiddenAt: new Date(), hideUser: app.session.user }); return this.save({ isHidden: true }).then(() => m.redraw()); }, @@ -134,7 +134,7 @@ export default { * @return {Promise} */ restoreAction() { - this.pushAttributes({ hideTime: null, hideUser: null }); + this.pushAttributes({ hiddenAt: null, hideUser: null }); return this.save({ isHidden: false }).then(() => m.redraw()); }, diff --git a/src/Api/Serializer/PostSerializer.php b/src/Api/Serializer/PostSerializer.php index 31305963f..888b32c3d 100644 --- a/src/Api/Serializer/PostSerializer.php +++ b/src/Api/Serializer/PostSerializer.php @@ -61,7 +61,7 @@ class PostSerializer extends BasicPostSerializer if ($post->hidden_at) { $attributes['isHidden'] = true; - $attributes['hideTime'] = $this->formatDate($post->hidden_at); + $attributes['hiddenAt'] = $this->formatDate($post->hidden_at); } $attributes += [