mirror of
https://github.com/flarum/framework.git
synced 2025-03-02 15:45:41 +08:00
Rename post.hideTime
This commit is contained in:
parent
8eb4a75da7
commit
767becec00
@ -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'),
|
||||
|
@ -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());
|
||||
},
|
||||
|
@ -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 += [
|
||||
|
Loading…
x
Reference in New Issue
Block a user