Bumped serializer to later in boot (#18181)

no refs
- import was too early in boot process, causing db init to fail
This commit is contained in:
Steve Larson 2023-09-15 11:32:12 -05:00 committed by GitHub
parent 077bd2c883
commit 37a9ffc63e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,12 +3,12 @@ const errors = require('@tryghost/errors');
const urlUtils = require('../../shared/url-utils');
const config = require('../../shared/config');
const storage = require('../adapters/storage');
const serializePosts = require('../api/endpoints/utils/serializers/output/posts').all;
let nodes;
let lexicalHtmlRenderer;
let urlTransformMap;
let postsService;
let serializePosts;
function populateNodes() {
const {DEFAULT_NODES} = require('@tryghost/kg-default-nodes');
@ -34,6 +34,9 @@ module.exports = {
const getPostServiceInstance = require('../services/posts/posts-service');
postsService = getPostServiceInstance();
}
if (!serializePosts) {
serializePosts = require('../api/endpoints/utils/serializers/output/posts').all;
}
const getCollectionPosts = async (collectionSlug, postCount) => {
const frame = {