mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
20 lines
461 B
JavaScript
20 lines
461 B
JavaScript
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
|
|
|
export default Ember.Controller.extend({
|
|
saving: false,
|
|
|
|
actions: {
|
|
save() {
|
|
this.set('saving', true);
|
|
|
|
this.get('model').save().then(() => {
|
|
this.transitionToRoute('group', this.get('model.name'));
|
|
this.send('closeModal');
|
|
}).catch(error => {
|
|
popupAjaxError(error);
|
|
}).finally(() => {
|
|
this.set('saving', false);
|
|
});
|
|
}
|
|
}
|
|
});
|