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,9 +60,9 @@ export default Controller.extend(ModalFunctionality, {
|
||||||
this._penalize("showSilenceModal", performAction);
|
this._penalize("showSilenceModal", performAction);
|
||||||
},
|
},
|
||||||
|
|
||||||
async _penalize(adminToolMethod, performAction) {
|
_penalize(adminToolMethod, performAction) {
|
||||||
if (this.adminTools) {
|
if (this.adminTools) {
|
||||||
let createdBy = await User.findByUsername(this.model.username);
|
return User.findByUsername(this.model.username).then((createdBy) => {
|
||||||
let postId = this.model.id;
|
let postId = this.model.id;
|
||||||
let postEdit = this.model.cooked;
|
let postEdit = this.model.cooked;
|
||||||
return this.adminTools[adminToolMethod](createdBy, {
|
return this.adminTools[adminToolMethod](createdBy, {
|
||||||
|
@ -70,6 +70,7 @@ export default Controller.extend(ModalFunctionality, {
|
||||||
postEdit,
|
postEdit,
|
||||||
before: performAction,
|
before: performAction,
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue