FEATURE: Option to update category preferences of all users when site setting changed (#8180)

This commit is contained in:
Vinoth Kannan
2019-10-15 18:41:27 +05:30
committed by GitHub
parent c3cc96084c
commit b2f682f35e
8 changed files with 173 additions and 18 deletions

View File

@ -111,21 +111,23 @@ export default Ember.Mixin.create({
actions: {
save() {
this._save()
.then(() => {
this.set("validationMessage", null);
this.commitBuffer();
if (AUTO_REFRESH_ON_SAVE.includes(this.get("setting.setting"))) {
this.afterSave();
}
})
.catch(e => {
if (e.jqXHR.responseJSON && e.jqXHR.responseJSON.errors) {
this.set("validationMessage", e.jqXHR.responseJSON.errors[0]);
} else {
this.set("validationMessage", I18n.t("generic_error"));
}
});
this._save(result => {
result
.then(() => {
this.set("validationMessage", null);
this.commitBuffer();
if (AUTO_REFRESH_ON_SAVE.includes(this.get("setting.setting"))) {
this.afterSave();
}
})
.catch(e => {
if (e.jqXHR.responseJSON && e.jqXHR.responseJSON.errors) {
this.set("validationMessage", e.jqXHR.responseJSON.errors[0]);
} else {
this.set("validationMessage", I18n.t("generic_error"));
}
});
});
},
cancel() {