mirror of
https://github.com/discourse/discourse.git
synced 2024-12-20 00:03:55 +08:00
0a499966e9
* DEV: Refactor setting component save callback * refactor site-setting component around new callback * add callback to theme-translation component * remove the save callback altogether
19 lines
548 B
JavaScript
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")
|
|
}
|
|
});
|
|
}
|
|
});
|