mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 03:06:53 +08:00
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:
@ -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,
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user