mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
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.
This commit is contained in:
parent
153a0c818f
commit
09ede03ce4
2 changed files with 3 additions and 3 deletions
|
@ -11,9 +11,6 @@ var EditorNewController = Ember.ObjectController.extend(EditorControllerMixin, {
|
|||
if (model.get('id')) {
|
||||
self.transitionToRoute('editor.edit', model);
|
||||
}
|
||||
}).catch(function () {
|
||||
// Publishing failed
|
||||
self.set('status', 'draft');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -211,6 +211,9 @@ var EditorControllerMixin = Ember.Mixin.create(MarkerManager, {
|
|||
return model;
|
||||
}).catch(function (errors) {
|
||||
self.showErrorNotification(prevStatus, self.get('status'), errors);
|
||||
|
||||
self.set('status', prevStatus);
|
||||
|
||||
return Ember.RSVP.reject(errors);
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue