mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 14:03:48 +03:00
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:
parent
30f3dea1e7
commit
b28beed755
@ -21,10 +21,6 @@ module.exports = {
|
||||
return require('./db');
|
||||
},
|
||||
|
||||
get integrations() {
|
||||
return require('./integrations');
|
||||
},
|
||||
|
||||
get pages() {
|
||||
return require('./pages');
|
||||
},
|
||||
|
@ -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)]
|
||||
};
|
||||
}
|
||||
};
|
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user