diff --git a/core/server/api/canary/utils/serializers/output/index.js b/core/server/api/canary/utils/serializers/output/index.js index 2d6560ba3b..1f4abcbf08 100644 --- a/core/server/api/canary/utils/serializers/output/index.js +++ b/core/server/api/canary/utils/serializers/output/index.js @@ -93,10 +93,6 @@ module.exports = { return require('./files'); }, - get tags() { - return require('./tags'); - }, - get users() { return require('./users'); }, diff --git a/core/server/api/canary/utils/serializers/output/tags.js b/core/server/api/canary/utils/serializers/output/tags.js deleted file mode 100644 index 9334c6b562..0000000000 --- a/core/server/api/canary/utils/serializers/output/tags.js +++ /dev/null @@ -1,25 +0,0 @@ -const debug = require('@tryghost/debug')('api:canary:utils:serializers:output:tags'); -const mappers = require('./mappers'); - -module.exports = { - all(models, apiConfig, frame) { - debug('all'); - - if (!models) { - return; - } - - if (models.meta) { - frame.response = { - tags: models.data.map(model => mappers.tags(model, frame)), - meta: models.meta - }; - - return; - } - - frame.response = { - tags: [mappers.tags(models, frame)] - }; - } -}; diff --git a/test/unit/api/canary/utils/serializers/output/tags.test.js b/test/unit/api/canary/utils/serializers/output/tags.test.js index d3d652e0f7..609cc84e37 100644 --- a/test/unit/api/canary/utils/serializers/output/tags.test.js +++ b/test/unit/api/canary/utils/serializers/output/tags.test.js @@ -20,7 +20,7 @@ describe('Unit: canary/utils/serializers/output/tags', function () { }); it('calls the mapper when single tag present', function () { - const apiConfig = {}; + const apiConfig = {docName: 'tags'}; const frame = { options: { context: {} @@ -29,14 +29,14 @@ describe('Unit: canary/utils/serializers/output/tags', function () { const ctrlResponse = tagModel(testUtils.DataGenerator.forKnex.createTag()); - serializers.output.tags.all(ctrlResponse, apiConfig, frame); + serializers.output.default.all(ctrlResponse, apiConfig, frame); mappers.tags.callCount.should.equal(1); mappers.tags.getCall(0).args.should.eql([ctrlResponse, frame]); }); it('calls the mapper with multiple tags', function () { - const apiConfig = {}; + const apiConfig = {docName: 'tags'}; const frame = { options: { context: {} @@ -51,7 +51,7 @@ describe('Unit: canary/utils/serializers/output/tags', function () { meta: {} }); - serializers.output.tags.all(ctrlResponse, apiConfig, frame); + serializers.output.default.all(ctrlResponse, apiConfig, frame); mappers.tags.callCount.should.equal(2); mappers.tags.getCall(0).args.should.eql([ctrlResponse.data[0], frame]);