0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Bug fix - unable to publish

- The addition of published/draft statuses to the post model on the frontend was being returned to the server.
- These additional properties are client-side only and are now unset before the model is saved
This commit is contained in:
Hannah Wolfe 2013-07-07 19:41:05 +01:00
parent b37f542448
commit d27f32fb4d
2 changed files with 6 additions and 0 deletions

View file

@ -8,6 +8,8 @@
status: 'draft'
},
blacklist: ['published', 'draft'],
parse: function (resp) {
if (resp.status) {
resp.published = !!(resp.status === "published");

View file

@ -130,6 +130,10 @@
savePost: function (data) {
// TODO: The content getter here isn't great, shouldn't rely on currentView.
_.each(this.model.blacklist, function (item) {
this.model.unset(item);
}, this);
var saved = this.model.save(_.extend({
title: $('#entry-title').val(),
content: Ghost.currentView.editor.getValue()