This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/controllers/edit-group.js.es6

21 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);
});
}
}
});