From d6f1e51dd6e20f4438262d35d45dc3a46f309e20 Mon Sep 17 00:00:00 2001 From: Naz Date: Mon, 20 Feb 2023 18:33:54 +0800 Subject: [PATCH] Removed outdated post serialization code refs https://github.com/TryGhost/Ghost/commit/0306c397d04779d22d93c3660fdf3f594da5e756 refs https://github.com/TryGhost/Toolbox/issues/522 - 'extraProperties' should have been cleaned up along with the referenced commit. This property does not perform any logic in current codebase (see ref) and makes it problematic to make "post" resource serialization more generic (for caching purposes). --- .../api/endpoints/utils/serializers/output/mappers/posts.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ghost/core/core/server/api/endpoints/utils/serializers/output/mappers/posts.js b/ghost/core/core/server/api/endpoints/utils/serializers/output/mappers/posts.js index a4a91f724a..52c27affba 100644 --- a/ghost/core/core/server/api/endpoints/utils/serializers/output/mappers/posts.js +++ b/ghost/core/core/server/api/endpoints/utils/serializers/output/mappers/posts.js @@ -23,11 +23,8 @@ const labs = require('../../../../../../../shared/labs'); module.exports = async (model, frame, options = {}) => { const {tiers: tiersData} = options || {}; - const extendedOptions = Object.assign(_.cloneDeep(frame.options), { - extraProperties: ['canonical_url'] - }); - const jsonModel = model.toJSON(extendedOptions); + const jsonModel = model.toJSON(frame.options); // Map email_recipient_filter to email_segment jsonModel.email_segment = jsonModel.email_recipient_filter;