0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00

Merge pull request #6513 from acburdine/issue-6512

Fix underscore usage in post serializer
This commit is contained in:
Kevin Ansfield 2016-02-18 09:30:44 +00:00
commit 0daabbe02f

View file

@ -11,13 +11,14 @@ export default ApplicationSerializer.extend(EmbeddedRecordsMixin, {
tags: {embedded: 'always'}
},
normalize(typeClass, hash, prop) {
normalizeHash: {
// this is to enable us to still access the raw authorId
// without requiring an extra get request (since it is an
// async relationship).
hash.authorId = hash.author;
return this._super(typeClass, hash, prop);
posts(hash) {
hash.author_id = hash.author;
return hash;
}
},
normalizeSingleResponse(store, primaryModelClass, payload) {
@ -47,7 +48,7 @@ export default ApplicationSerializer.extend(EmbeddedRecordsMixin, {
delete data.uuid;
delete data.html;
// Inserted locally as a convenience.
delete data.authorId;
delete data.author_id;
// Read-only virtual property.
delete data.url;