A new settings section in the review queue allows admins to specify that certain types of flags should be weighted higher than others.
25 lines
623 B
JavaScript
25 lines
623 B
JavaScript
import { ajax } from "discourse/lib/ajax";
|
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
|
|
|
export default Ember.Controller.extend({
|
|
saving: false,
|
|
saved: false,
|
|
|
|
actions: {
|
|
save() {
|
|
let bonuses = {};
|
|
this.get("settings.reviewable_score_types").forEach(st => {
|
|
bonuses[st.id] = parseFloat(st.score_bonus);
|
|
});
|
|
|
|
this.set("saving", true);
|
|
ajax("/review/settings", { method: "PUT", data: { bonuses } })
|
|
.then(() => {
|
|
this.set("saved", true);
|
|
})
|
|
.catch(popupAjaxError)
|
|
.finally(() => this.set("saving", false));
|
|
}
|
|
}
|
|
});
|