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:
Chris Raible 2023-04-19 14:20:52 +01:00
parent 78da6cf77d
commit 24b06e3a34
2 changed files with 15 additions and 1 deletions

View 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'}
};
}

View File

@ -12,7 +12,7 @@ export default class PostSerializer extends ApplicationSerializer.extend(Embedde
updatedAtUTC: {key: 'updated_at'}, updatedAtUTC: {key: 'updated_at'},
email: {embedded: 'always'}, email: {embedded: 'always'},
newsletter: {embedded: 'always'}, newsletter: {embedded: 'always'},
postRevisions: {embedded: 'always', key: 'postRevisions'} postRevisions: {embedded: 'always'}
}; };
serialize(/*snapshot, options*/) { serialize(/*snapshot, options*/) {