FIX: theme component setting was not getting updated in the UI (#8247)

This commit is contained in:
Joffrey JAFFEUX 2019-10-28 10:33:31 +01:00 committed by GitHub
parent af841fa883
commit 88df84bf2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,13 +6,16 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
export default Component.extend(BufferedContent, SettingComponent, {
layoutName: "admin/templates/components/site-setting",
_save() {
return ajax(`/admin/themes/${this.model.id}/setting`, {
type: "PUT",
data: {
name: this.setting.setting,
value: this.get("buffered.value")
}
}).catch(popupAjaxError);
_save(callback) {
callback(
ajax(`/admin/themes/${this.model.id}/setting`, {
type: "PUT",
data: {
name: this.setting.setting,
value: this.get("buffered.value")
}
}).catch(popupAjaxError)
);
}
});