Ghost/ghost/admin/controllers/editor/new.js
Jason Williams 09ede03ce4 Revert post status on failed save.
Refs #3667, Refs #3776
- If saving a post fails, revert its status back to the
  pre-save value.
- Added tests to check post status after failed save attempt
  on both new and existing posts.
2014-08-15 00:22:10 +00:00

20 lines
550 B
JavaScript

import EditorControllerMixin from 'ghost/mixins/editor-base-controller';
var EditorNewController = Ember.ObjectController.extend(EditorControllerMixin, {
actions: {
/**
* Redirect to editor after the first save
*/
save: function () {
var self = this;
this._super().then(function (model) {
if (model.get('id')) {
self.transitionToRoute('editor.edit', model);
}
});
}
}
});
export default EditorNewController;