mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
Wired up the author details to the post history modal
no issue - added post-revision serializer to allow for embedded records in the post-revision ember model
This commit is contained in:
parent
78da6cf77d
commit
24b06e3a34
14
ghost/admin/app/serializers/post-revision.js
Normal file
14
ghost/admin/app/serializers/post-revision.js
Normal file
@ -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'}
|
||||
};
|
||||
}
|
@ -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*/) {
|
||||
|
Loading…
Reference in New Issue
Block a user