discourse/app/assets/javascripts/admin/controllers/admin-customize-email-templates-edit.js.es6

17 lines
500 B
JavaScript

import { popupAjaxError } from 'discourse/lib/ajax-error';
import { bufferedProperty } from 'discourse/mixins/buffered-content';
export default Ember.Controller.extend(bufferedProperty('emailTemplate'), {
saved: false,
actions: {
saveChanges() {
const model = this.get('emailTemplate');
const buffered = this.get('buffered');
model.save(buffered.getProperties('subject', 'body')).then(() => {
this.set('saved', true);
}).catch(popupAjaxError);
}
}
});