mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-12 16:14:25 +03:00
Merge pull request #6713 from acburdine/follow-up-6711
Follow up from #6711
This commit is contained in:
commit
2e9c8a9421
@ -9,14 +9,15 @@ export default ApplicationSerializer.extend(EmbeddedRecordsMixin, {
|
|||||||
tags: {embedded: 'always'}
|
tags: {embedded: 'always'}
|
||||||
},
|
},
|
||||||
|
|
||||||
normalizeHash: {
|
normalize(model, hash, prop) {
|
||||||
// this is to enable us to still access the raw authorId
|
// this is to enable us to still access the raw authorId
|
||||||
// without requiring an extra get request (since it is an
|
// without requiring an extra get request (since it is an
|
||||||
// async relationship).
|
// async relationship).
|
||||||
posts(hash) {
|
if ((prop === 'post' || prop === 'posts') && hash.author !== undefined) {
|
||||||
hash.author_id = hash.author;
|
hash.author_id = hash.author;
|
||||||
return hash;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return this._super(...arguments);
|
||||||
},
|
},
|
||||||
|
|
||||||
normalizeSingleResponse(store, primaryModelClass, payload) {
|
normalizeSingleResponse(store, primaryModelClass, payload) {
|
||||||
|
Loading…
Reference in New Issue
Block a user