Removed unnecessary users.* serializers

refs: https://github.com/TryGhost/Toolbox/issues/245
refs: https://github.com/TryGhost/Ghost/commit/73f91a524

- we don't need these 3 serializers because the default serializer will do the same thing
- commit 73f91a524 fixes the logic so that the default serializer is called as a fallback
  even though the users serializer exists, as there's no matching method name
This commit is contained in:
Hannah Wolfe 2022-03-29 14:45:36 +01:00
parent f096e29922
commit 018ff26f6e
No known key found for this signature in database
GPG Key ID: AB586C3B5AE5C037

View File

@ -1,34 +1,11 @@
const debug = require('@tryghost/debug')('api:canary:utils:serializers:output:users'); const debug = require('@tryghost/debug')('api:canary:utils:serializers:output:users');
const tpl = require('@tryghost/tpl'); const tpl = require('@tryghost/tpl');
const mappers = require('./mappers');
const messages = { const messages = {
pwdChangedSuccessfully: 'Password changed successfully.' pwdChangedSuccessfully: 'Password changed successfully.'
}; };
module.exports = { module.exports = {
browse(models, apiConfig, frame) {
debug('browse');
frame.response = {
users: models.data.map(model => mappers.users(model, frame)),
meta: models.meta
};
},
read(model, apiConfig, frame) {
debug('read');
frame.response = {
users: [mappers.users(model, frame)]
};
},
edit() {
debug('edit');
this.read(...arguments);
},
destroy(filename, apiConfig, frame) { destroy(filename, apiConfig, frame) {
debug('destroy'); debug('destroy');