discourse/app/assets/javascripts/admin/components/theme-setting-editor.js.es6
Mark VanLandingham 0a499966e9
DEV: Refactor setting component save callback (#8261)
* DEV: Refactor setting component save callback

* refactor site-setting component around new callback

* add callback to theme-translation component

* remove the save callback altogether
2019-10-29 12:01:45 -05:00

19 lines
548 B
JavaScript

import Component from "@ember/component";
import BufferedContent from "discourse/mixins/buffered-content";
import SettingComponent from "admin/mixins/setting-component";
import { ajax } from "discourse/lib/ajax";
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")
}
});
}
});