Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
πŸ› Fixed plaintext field not being updated when modifying a post
Browse files Browse the repository at this point in the history
refs TryGhost/Ghost#9512
- if values for auto-generated fields are passed to Ghost via the API then those values will override any auto-generated value and be saved to the database
- add `plaintext` attribute to list of attributes we strip when serialising to avoid the issue until Ghost has appropriate protections in place
  • Loading branch information
kevinansfield committed Apr 9, 2018
1 parent 2615e13 commit 426e5a8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/serializers/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export default ApplicationSerializer.extend(EmbeddedRecordsMixin, {

// Properties that exist on the model but we don't want sent in the payload
delete json.uuid;
// Server-side-generated fields
// TODO: remove once the API has protection against overriding auto generation
delete json.html;
delete json.plaintext;
// Inserted locally as a convenience.
delete json.author_id;
// Read-only virtual property.
Expand Down

0 comments on commit 426e5a8

Please sign in to comment.