DEV: rewrite _penalize without async (#10935)
* DEV: rewrite _penalize without async async is not yet supported in object methods due to uglifyjs.
This commit is contained in:
parent
5763309953
commit
e9eeea26b2
|
@ -60,15 +60,16 @@ export default Controller.extend(ModalFunctionality, {
|
|||
this._penalize("showSilenceModal", performAction);
|
||||
},
|
||||
|
||||
async _penalize(adminToolMethod, performAction) {
|
||||
_penalize(adminToolMethod, performAction) {
|
||||
if (this.adminTools) {
|
||||
let createdBy = await User.findByUsername(this.model.username);
|
||||
let postId = this.model.id;
|
||||
let postEdit = this.model.cooked;
|
||||
return this.adminTools[adminToolMethod](createdBy, {
|
||||
postId,
|
||||
postEdit,
|
||||
before: performAction,
|
||||
return User.findByUsername(this.model.username).then((createdBy) => {
|
||||
let postId = this.model.id;
|
||||
let postEdit = this.model.cooked;
|
||||
return this.adminTools[adminToolMethod](createdBy, {
|
||||
postId,
|
||||
postEdit,
|
||||
before: performAction,
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue