mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 20:51:50 +08:00
17 lines
500 B
JavaScript
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);
|
|
}
|
|
}
|
|
});
|