FIX: Group validation errors were not being displayed

This commit is contained in:
Robin Ward 2015-05-21 14:57:45 -04:00
parent 0ed1c8011c
commit 1a4a2f5fc0
1 changed files with 3 additions and 1 deletions

View File

@ -1,3 +1,5 @@
import { popupAjaxError } from 'discourse/lib/ajax-error';
export default Em.ObjectController.extend({ export default Em.ObjectController.extend({
needs: ['adminGroupsType'], needs: ['adminGroupsType'],
disableSave: false, disableSave: false,
@ -73,7 +75,7 @@ export default Em.ObjectController.extend({
let promise = group.get("id") ? group.save() : group.create().then(() => groupsController.addObject(group)); let promise = group.get("id") ? group.save() : group.create().then(() => groupsController.addObject(group));
promise.then(() => this.transitionToRoute("adminGroup", group)) promise.then(() => this.transitionToRoute("adminGroup", group))
.catch(e => bootbox.alert($.parseJSON(e.responseText).errors)) .catch(popupAjaxError)
.finally(() => this.set('disableSave', false)); .finally(() => this.set('disableSave', false));
}, },