From 1c4070a0343b5ad89253e19602c1df076368c08a Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 24 Aug 2018 21:30:06 +0930 Subject: [PATCH] Rename post.hideUser --- framework/core/js/src/common/models/Post.js | 2 +- framework/core/js/src/forum/utils/PostControls.js | 4 ++-- framework/core/src/Api/Controller/ListPostsController.php | 2 +- .../core/src/Api/Controller/ShowDiscussionController.php | 2 +- framework/core/src/Api/Controller/ShowPostController.php | 2 +- framework/core/src/Api/Serializer/PostSerializer.php | 2 +- framework/core/src/Post/Post.php | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/framework/core/js/src/common/models/Post.js b/framework/core/js/src/common/models/Post.js index 1b87e6722..fa0c434f6 100644 --- a/framework/core/js/src/common/models/Post.js +++ b/framework/core/js/src/common/models/Post.js @@ -20,7 +20,7 @@ Object.assign(Post.prototype, { isEdited: computed('editedAt', editedAt => !!editedAt), hiddenAt: Model.attribute('hiddenAt', Model.transformDate), - hideUser: Model.hasOne('hideUser'), + hiddenUser: Model.hasOne('hiddenUser'), isHidden: computed('hiddenAt', hiddenAt => !!hiddenAt), canEdit: Model.attribute('canEdit'), diff --git a/framework/core/js/src/forum/utils/PostControls.js b/framework/core/js/src/forum/utils/PostControls.js index d90528898..574b039bf 100644 --- a/framework/core/js/src/forum/utils/PostControls.js +++ b/framework/core/js/src/forum/utils/PostControls.js @@ -123,7 +123,7 @@ export default { * @return {Promise} */ hideAction() { - this.pushAttributes({ hiddenAt: new Date(), hideUser: app.session.user }); + this.pushAttributes({ hiddenAt: new Date(), hiddenUser: app.session.user }); return this.save({ isHidden: true }).then(() => m.redraw()); }, @@ -134,7 +134,7 @@ export default { * @return {Promise} */ restoreAction() { - this.pushAttributes({ hiddenAt: null, hideUser: null }); + this.pushAttributes({ hiddenAt: null, hiddenUser: null }); return this.save({ isHidden: false }).then(() => m.redraw()); }, diff --git a/framework/core/src/Api/Controller/ListPostsController.php b/framework/core/src/Api/Controller/ListPostsController.php index dbec57c47..f2740778d 100644 --- a/framework/core/src/Api/Controller/ListPostsController.php +++ b/framework/core/src/Api/Controller/ListPostsController.php @@ -33,7 +33,7 @@ class ListPostsController extends AbstractListController 'user', 'user.groups', 'editedUser', - 'hideUser', + 'hiddenUser', 'discussion' ]; diff --git a/framework/core/src/Api/Controller/ShowDiscussionController.php b/framework/core/src/Api/Controller/ShowDiscussionController.php index 0cf94b253..ae30f47fc 100644 --- a/framework/core/src/Api/Controller/ShowDiscussionController.php +++ b/framework/core/src/Api/Controller/ShowDiscussionController.php @@ -45,7 +45,7 @@ class ShowDiscussionController extends AbstractShowController 'posts.user', 'posts.user.groups', 'posts.editedUser', - 'posts.hideUser' + 'posts.hiddenUser' ]; /** diff --git a/framework/core/src/Api/Controller/ShowPostController.php b/framework/core/src/Api/Controller/ShowPostController.php index da88668c9..dcec04ba9 100644 --- a/framework/core/src/Api/Controller/ShowPostController.php +++ b/framework/core/src/Api/Controller/ShowPostController.php @@ -30,7 +30,7 @@ class ShowPostController extends AbstractShowController 'user', 'user.groups', 'editedUser', - 'hideUser', + 'hiddenUser', 'discussion' ]; diff --git a/framework/core/src/Api/Serializer/PostSerializer.php b/framework/core/src/Api/Serializer/PostSerializer.php index c4996ecf4..44ec76460 100644 --- a/framework/core/src/Api/Serializer/PostSerializer.php +++ b/framework/core/src/Api/Serializer/PostSerializer.php @@ -100,7 +100,7 @@ class PostSerializer extends BasicPostSerializer /** * @return \Tobscure\JsonApi\Relationship */ - protected function hideUser($post) + protected function hiddenUser($post) { return $this->hasOne($post, BasicUserSerializer::class); } diff --git a/framework/core/src/Post/Post.php b/framework/core/src/Post/Post.php index 947495545..0a416d5bd 100644 --- a/framework/core/src/Post/Post.php +++ b/framework/core/src/Post/Post.php @@ -35,7 +35,7 @@ use Illuminate\Database\Eloquent\Builder; * @property \Flarum\Discussion\Discussion|null $discussion * @property User|null $user * @property User|null $editedUser - * @property User|null $hideUser + * @property User|null $hiddenUser * @property string $ip_address * @property bool $is_private */ @@ -177,7 +177,7 @@ class Post extends AbstractModel * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function hideUser() + public function hiddenUser() { return $this->belongsTo(User::class, 'hidden_user_id'); }