mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Merge pull request #6713 from acburdine/follow-up-6711
Follow up from #6711
This commit is contained in:
commit
2e9c8a9421
1 changed files with 4 additions and 3 deletions
|
@ -9,14 +9,15 @@ export default ApplicationSerializer.extend(EmbeddedRecordsMixin, {
|
|||
tags: {embedded: 'always'}
|
||||
},
|
||||
|
||||
normalizeHash: {
|
||||
normalize(model, hash, prop) {
|
||||
// this is to enable us to still access the raw authorId
|
||||
// without requiring an extra get request (since it is an
|
||||
// async relationship).
|
||||
posts(hash) {
|
||||
if ((prop === 'post' || prop === 'posts') && hash.author !== undefined) {
|
||||
hash.author_id = hash.author;
|
||||
return hash;
|
||||
}
|
||||
|
||||
return this._super(...arguments);
|
||||
},
|
||||
|
||||
normalizeSingleResponse(store, primaryModelClass, payload) {
|
||||
|
|
Loading…
Add table
Reference in a new issue