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:
parent
9db1694647
commit
2b6b31ee14
4 changed files with 2 additions and 25 deletions
|
@ -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)]
|
||||
};
|
||||
}
|
||||
};
|
|
@ -109,10 +109,6 @@ module.exports = {
|
|||
return require('./oembed');
|
||||
},
|
||||
|
||||
get authors() {
|
||||
return require('./authors');
|
||||
},
|
||||
|
||||
get config() {
|
||||
return require('./config');
|
||||
},
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
module.exports = require('./users');
|
|
@ -1,5 +1,6 @@
|
|||
module.exports = {
|
||||
actions: require('./actions'),
|
||||
authors: require('./authors'),
|
||||
emails: require('./emails'),
|
||||
images: require('./images'),
|
||||
integrations: require('./integrations'),
|
||||
|
|
Loading…
Add table
Reference in a new issue