mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 23:23:52 +08:00
Rename discussion.hideTime
This commit is contained in:
parent
2ba550afa7
commit
dc4e650091
|
@ -28,9 +28,9 @@ Object.assign(Discussion.prototype, {
|
|||
isUnread: computed('unreadCount', unreadCount => !!unreadCount),
|
||||
isRead: computed('unreadCount', unreadCount => app.session.user && !unreadCount),
|
||||
|
||||
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),
|
||||
|
||||
canReply: Model.attribute('canReply'),
|
||||
canRename: Model.attribute('canRename'),
|
||||
|
|
|
@ -183,7 +183,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 });
|
||||
},
|
||||
|
@ -194,7 +194,7 @@ export default {
|
|||
* @return {Promise}
|
||||
*/
|
||||
restoreAction() {
|
||||
this.pushAttributes({ hideTime: null, hideUser: null });
|
||||
this.pushAttributes({ hiddenAt: null, hideUser: null });
|
||||
|
||||
return this.save({ isHidden: false });
|
||||
},
|
||||
|
|
|
@ -50,7 +50,7 @@ class DiscussionSerializer extends BasicDiscussionSerializer
|
|||
|
||||
if ($discussion->hidden_at) {
|
||||
$attributes['isHidden'] = true;
|
||||
$attributes['hideTime'] = $this->formatDate($discussion->hidden_at);
|
||||
$attributes['hiddenAt'] = $this->formatDate($discussion->hidden_at);
|
||||
}
|
||||
|
||||
Discussion::setStateUser($this->actor);
|
||||
|
|
Loading…
Reference in New Issue
Block a user