mirror of
https://github.com/flarum/framework.git
synced 2025-05-22 14:49:57 +08:00
Rename post.hideUser
This commit is contained in:
@ -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'),
|
||||
|
@ -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());
|
||||
},
|
||||
|
Reference in New Issue
Block a user