Removed unnecessary integrations serializer

refs: https://github.com/TryGhost/Toolbox/issues/245

- we don't need this serializer because the default serializer will call the integrations mapper
This commit is contained in:
Hannah Wolfe 2022-03-21 20:46:16 +00:00
parent 30f3dea1e7
commit b28beed755
3 changed files with 1 additions and 30 deletions

View File

@ -21,10 +21,6 @@ module.exports = {
return require('./db'); return require('./db');
}, },
get integrations() {
return require('./integrations');
},
get pages() { get pages() {
return require('./pages'); return require('./pages');
}, },

View File

@ -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)]
};
}
};

View File

@ -1,5 +1,5 @@
module.exports = (model, frame) => { module.exports = (model, frame) => {
const jsonModel = model.toJSON ? model.toJSON(frame.options) : model; const jsonModel = model.toJSON(frame.options);
if (jsonModel.api_keys) { if (jsonModel.api_keys) {
jsonModel.api_keys.forEach((key) => { jsonModel.api_keys.forEach((key) => {