diff --git a/core/client/app/controllers/modals/delete-all.js b/core/client/app/controllers/modals/delete-all.js index 4ea73dd6e4..dc19efda5c 100644 --- a/core/client/app/controllers/modals/delete-all.js +++ b/core/client/app/controllers/modals/delete-all.js @@ -16,7 +16,7 @@ export default Ember.Controller.extend({ self.store.unloadAll('post'); self.store.unloadAll('tag'); }).catch(function (response) { - self.get('notifications').showErrors(response); + self.get('notifications').showAPIError(response); }); }, diff --git a/core/client/app/controllers/modals/invite-new-user.js b/core/client/app/controllers/modals/invite-new-user.js index cf8fdd95ca..5f8e66f511 100644 --- a/core/client/app/controllers/modals/invite-new-user.js +++ b/core/client/app/controllers/modals/invite-new-user.js @@ -78,6 +78,10 @@ export default Ember.Controller.extend({ } }).catch(function (errors) { newUser.deleteRecord(); + // TODO: user model includes ValidationEngine mixin so + // save is overridden in order to validate, we probably + // want to use inline-validations here and only show an + // alert if we have an actual error self.get('notifications').showErrors(errors); }); } diff --git a/core/client/app/controllers/modals/upload.js b/core/client/app/controllers/modals/upload.js index a288447d56..f11abae874 100644 --- a/core/client/app/controllers/modals/upload.js +++ b/core/client/app/controllers/modals/upload.js @@ -12,7 +12,7 @@ export default Ember.Controller.extend({ this.get('model').save().then(function (model) { return model; }).catch(function (err) { - notifications.showErrors(err); + notifications.showAPIError(err); }); }, diff --git a/core/client/app/controllers/reset.js b/core/client/app/controllers/reset.js index 92304f0c80..4f0a2d6307 100644 --- a/core/client/app/controllers/reset.js +++ b/core/client/app/controllers/reset.js @@ -33,8 +33,8 @@ export default Ember.Controller.extend(ValidationEngine, { var credentials = this.getProperties('newPassword', 'ne2Password', 'token'), self = this; - this.toggleProperty('submitting'); - this.validate({format: false}).then(function () { + this.validate().then(function () { + self.toggleProperty('submitting'); ajax({ url: self.get('ghostPaths.url').api('authentication', 'passwordreset'), type: 'PUT', @@ -52,9 +52,6 @@ export default Ember.Controller.extend(ValidationEngine, { self.get('notifications').showAPIError(response); self.toggleProperty('submitting'); }); - }).catch(function (error) { - self.toggleProperty('submitting'); - self.get('notifications').showErrors(error); }); } } diff --git a/core/client/app/controllers/settings/code-injection.js b/core/client/app/controllers/settings/code-injection.js index 043c1efd14..c68c63ee95 100644 --- a/core/client/app/controllers/settings/code-injection.js +++ b/core/client/app/controllers/settings/code-injection.js @@ -8,12 +8,9 @@ export default Ember.Controller.extend({ var notifications = this.get('notifications'); return this.get('model').save().then(function (model) { - notifications.closeNotifications(); - return model; - }).catch(function (errors) { - notifications.closeNotifications(); - notifications.showErrors(errors); + }).catch(function (error) { + notifications.showAPIError(error); }); } }