diff --git a/ghost/admin/app/serializers/post-revision.js b/ghost/admin/app/serializers/post-revision.js new file mode 100644 index 0000000000..593e6f4e4c --- /dev/null +++ b/ghost/admin/app/serializers/post-revision.js @@ -0,0 +1,14 @@ +/* eslint-disable camelcase */ +import ApplicationSerializer from 'ghost-admin/serializers/application'; +import {EmbeddedRecordsMixin} from '@ember-data/serializer/rest'; + +export default class PostRevisionSerializer extends ApplicationSerializer.extend(EmbeddedRecordsMixin) { + // settings for the EmbeddedRecordsMixin. + attrs = { + author: {embedded: 'always'}, + lexical: {key: 'lexical'}, + title: {key: 'title'}, + createdAt: {key: 'created_at'}, + postIdLocal: {key: 'post_id'} + }; +} diff --git a/ghost/admin/app/serializers/post.js b/ghost/admin/app/serializers/post.js index 83d1c585e1..78775c3536 100644 --- a/ghost/admin/app/serializers/post.js +++ b/ghost/admin/app/serializers/post.js @@ -12,7 +12,7 @@ export default class PostSerializer extends ApplicationSerializer.extend(Embedde updatedAtUTC: {key: 'updated_at'}, email: {embedded: 'always'}, newsletter: {embedded: 'always'}, - postRevisions: {embedded: 'always', key: 'postRevisions'} + postRevisions: {embedded: 'always'} }; serialize(/*snapshot, options*/) {