diff --git a/core/server/api/canary/utils/serializers/output/index.js b/core/server/api/canary/utils/serializers/output/index.js index b0253aff86..2d6560ba3b 100644 --- a/core/server/api/canary/utils/serializers/output/index.js +++ b/core/server/api/canary/utils/serializers/output/index.js @@ -21,10 +21,6 @@ module.exports = { return require('./db'); }, - get integrations() { - return require('./integrations'); - }, - get pages() { return require('./pages'); }, diff --git a/core/server/api/canary/utils/serializers/output/integrations.js b/core/server/api/canary/utils/serializers/output/integrations.js deleted file mode 100644 index ecc8b17ff5..0000000000 --- a/core/server/api/canary/utils/serializers/output/integrations.js +++ /dev/null @@ -1,25 +0,0 @@ -const debug = require('@tryghost/debug')('api:canary:utils:serializers:output:integrations'); -const mappers = require('./mappers'); - -module.exports = { - all(models, apiConfig, frame) { - debug('all'); - - if (!models) { - return; - } - - if (models.meta) { - frame.response = { - integrations: models.data.map(model => mappers.integrations(model, frame)), - meta: models.meta - }; - - return; - } - - frame.response = { - integrations: [mappers.integrations(models, frame)] - }; - } -}; diff --git a/core/server/api/canary/utils/serializers/output/mappers/integrations.js b/core/server/api/canary/utils/serializers/output/mappers/integrations.js index 9e1f1bc8ae..dbe7b5c5c0 100644 --- a/core/server/api/canary/utils/serializers/output/mappers/integrations.js +++ b/core/server/api/canary/utils/serializers/output/mappers/integrations.js @@ -1,5 +1,5 @@ module.exports = (model, frame) => { - const jsonModel = model.toJSON ? model.toJSON(frame.options) : model; + const jsonModel = model.toJSON(frame.options); if (jsonModel.api_keys) { jsonModel.api_keys.forEach((key) => {