From a188cfe677d2438f2f8fdd84ca122c7bd9ff444b Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Fri, 18 Mar 2022 14:48:27 +0000 Subject: [PATCH] Added serializer for session.all refs: https://github.com/TryGhost/Toolbox/issues/245 - Session didn't have a serializer because it's deliberately a passthrough - With the upcoming refactor we want to have all the serializers defined explicitly - This will allow us to change the default behaviour - Tests were added to cover this endpoint in https://github.com/TryGhost/Ghost/commit/2cf7e0049381d32b509ed0bed0619060b4652f10 --- core/server/api/canary/utils/serializers/output/index.js | 4 ++++ .../api/canary/utils/serializers/output/session.js | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 core/server/api/canary/utils/serializers/output/session.js diff --git a/core/server/api/canary/utils/serializers/output/index.js b/core/server/api/canary/utils/serializers/output/index.js index 257f03e72f..8a78521109 100644 --- a/core/server/api/canary/utils/serializers/output/index.js +++ b/core/server/api/canary/utils/serializers/output/index.js @@ -159,5 +159,9 @@ module.exports = { get slack() { return require('./slack'); + }, + + get session() { + return require('./session'); } }; diff --git a/core/server/api/canary/utils/serializers/output/session.js b/core/server/api/canary/utils/serializers/output/session.js new file mode 100644 index 0000000000..9d5e040642 --- /dev/null +++ b/core/server/api/canary/utils/serializers/output/session.js @@ -0,0 +1,9 @@ +const debug = require('@tryghost/debug')('api:canary:utils:serializers:output:session'); + +module.exports = { + all(data, apiConfig, frame) { + debug('all'); + + frame.response = data; + } +};