mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 01:41:46 +03:00
09ede03ce4
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.
20 lines
550 B
JavaScript
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;
|