Ghost/ghost/admin/app/serializers/post-revision.js
Fabien "egg" O'Carroll 5feedadc80 Wired up feature image alt and caption to DB and Admin
We no longer need a reference to the previous version, instead we can use the
latest revision, this makes it easier to compare "off table" data such as the
feature image caption stored in posts_meta.
2023-04-21 15:26:43 +01:00

20 lines
762 B
JavaScript

/* 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'},
postStatus: {key: 'post_status'},
reason: {key: 'reason'},
featureImage: {key: 'feature_image'},
featureImageAlt: {key: 'feature_image_alt'},
featureImageCaption: {key: 'feature_image_caption'},
postIdLocal: {key: 'post_id'}
};
}