0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Removed unnecessary authors serializer

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

- we don't need this serializer because the default serializer will call the authors mapper
- added an author mapper which is just an alias for users. I did this in a named file, not in index.js
  - because we want to change the api framework to load files automatically without needing index files.
  - makes sense to hold off that deeper change until we only have one api version else we have to change old APIs
This commit is contained in:
Hannah Wolfe 2022-03-21 20:44:47 +00:00
parent 9db1694647
commit 2b6b31ee14
No known key found for this signature in database
GPG key ID: AB586C3B5AE5C037
4 changed files with 2 additions and 25 deletions

View file

@ -1,21 +0,0 @@
const debug = require('@tryghost/debug')('api:canary:utils:serializers:output:authors');
const mappers = require('./mappers');
module.exports = {
browse(models, apiConfig, frame) {
debug('browse');
frame.response = {
authors: models.data.map(model => mappers.users(model, frame)),
meta: models.meta
};
},
read(model, apiConfig, frame) {
debug('read');
frame.response = {
authors: [mappers.users(model, frame)]
};
}
};

View file

@ -109,10 +109,6 @@ module.exports = {
return require('./oembed');
},
get authors() {
return require('./authors');
},
get config() {
return require('./config');
},

View file

@ -0,0 +1 @@
module.exports = require('./users');

View file

@ -1,5 +1,6 @@
module.exports = {
actions: require('./actions'),
authors: require('./authors'),
emails: require('./emails'),
images: require('./images'),
integrations: require('./integrations'),