mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-01 11:28:15 -05:00
17 lines
500 B
Text
17 lines
500 B
Text
|
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);
|
||
|
}
|
||
|
}
|
||
|
});
|