mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 01:56:58 +08:00
22 lines
664 B
JavaScript
22 lines
664 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";
|
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
|
|
|
export default Component.extend(BufferedContent, SettingComponent, {
|
|
layoutName: "admin/templates/components/site-setting",
|
|
|
|
_save(callback) {
|
|
callback(
|
|
ajax(`/admin/themes/${this.model.id}/setting`, {
|
|
type: "PUT",
|
|
data: {
|
|
name: this.setting.setting,
|
|
value: this.get("buffered.value")
|
|
}
|
|
}).catch(popupAjaxError)
|
|
);
|
|
}
|
|
});
|