2018-06-15 11:03:24 -04:00
|
|
|
import { ajax } from "discourse/lib/ajax";
|
|
|
|
import RestModel from "discourse/models/rest";
|
2015-11-20 12:30:04 -05:00
|
|
|
const { getProperties } = Ember;
|
|
|
|
|
|
|
|
export default RestModel.extend({
|
|
|
|
revert() {
|
2018-06-15 11:03:24 -04:00
|
|
|
return ajax(`/admin/customize/email_templates/${this.get("id")}`, {
|
|
|
|
method: "DELETE"
|
|
|
|
}).then(result =>
|
|
|
|
getProperties(result.email_template, "subject", "body", "can_revert")
|
|
|
|
);
|
2015-11-20 12:30:04 -05:00
|
|
|
}
|
|
|
|
});
|