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:
parent
b37f542448
commit
d27f32fb4d
2 changed files with 6 additions and 0 deletions
|
@ -8,6 +8,8 @@
|
||||||
status: 'draft'
|
status: 'draft'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
blacklist: ['published', 'draft'],
|
||||||
|
|
||||||
parse: function (resp) {
|
parse: function (resp) {
|
||||||
if (resp.status) {
|
if (resp.status) {
|
||||||
resp.published = !!(resp.status === "published");
|
resp.published = !!(resp.status === "published");
|
||||||
|
|
|
@ -130,6 +130,10 @@
|
||||||
|
|
||||||
savePost: function (data) {
|
savePost: function (data) {
|
||||||
// TODO: The content getter here isn't great, shouldn't rely on currentView.
|
// 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({
|
var saved = this.model.save(_.extend({
|
||||||
title: $('#entry-title').val(),
|
title: $('#entry-title').val(),
|
||||||
content: Ghost.currentView.editor.getValue()
|
content: Ghost.currentView.editor.getValue()
|
||||||
|
|
Loading…
Add table
Reference in a new issue