2018-06-15 17:03:24 +02:00
|
|
|
import RestModel from "discourse/models/rest";
|
2020-12-01 15:31:26 -03:00
|
|
|
import { ajax } from "discourse/lib/ajax";
|
2021-01-18 14:53:45 -03:00
|
|
|
import { getProperties } from "@ember/object";
|
2015-08-07 14:05:08 -04:00
|
|
|
|
2023-03-17 10:18:42 +00:00
|
|
|
export default class SiteText extends RestModel {
|
2021-01-18 14:53:45 -03:00
|
|
|
revert(locale) {
|
|
|
|
return ajax(`/admin/customize/site_texts/${this.id}?locale=${locale}`, {
|
2020-09-04 13:42:47 +02:00
|
|
|
type: "DELETE",
|
|
|
|
}).then((result) => getProperties(result.site_text, "value", "can_revert"));
|
2023-03-17 10:18:42 +00: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 10:18:42 +00:00
|
|
|
}
|