2021-01-19 01:53:45 +08:00
|
|
|
import { getProperties } from "@ember/object";
|
2023-10-11 02:38:59 +08:00
|
|
|
import { ajax } from "discourse/lib/ajax";
|
|
|
|
import RestModel from "discourse/models/rest";
|
2015-08-08 02:05:08 +08:00
|
|
|
|
2023-03-17 18:18:42 +08:00
|
|
|
export default class SiteText extends RestModel {
|
2021-01-19 01:53:45 +08:00
|
|
|
revert(locale) {
|
|
|
|
return ajax(`/admin/customize/site_texts/${this.id}?locale=${locale}`, {
|
2020-03-27 04:00:10 +08:00
|
|
|
type: "DELETE",
|
2015-11-24 05:45:05 +08:00
|
|
|
}).then((result) => getProperties(result.site_text, "value", "can_revert"));
|
2023-03-17 18:18:42 +08:00
|
|
|
}
|
2023-07-19 23:06:13 +08:00
|
|
|
|
|
|
|
dismissOutdated(locale) {
|
|
|
|
return ajax(
|
|
|
|
`/admin/customize/site_texts/${this.id}/dismiss_outdated?locale=${locale}`,
|
|
|
|
{
|
|
|
|
type: "PUT",
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
2023-03-17 18:18:42 +08:00
|
|
|
}
|