0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-08 02:52:39 -05:00
ghost/core
Fabien 'egg' O'Carroll c19d282a51
Ensured Admin API members resource only returns known fields (#12240)
refs #12055

As part of the work in TryGhost/Members#206 we load the stripeCustomers relation on the member model, and we do not want this to be part of the API response. The changes here include a refactor but the main thing is that the serialized object is explicit and does not include unexpected or unknown fields.

* Moved mapMember out of mapper file

This cleans up the serializer a bit by keeping it's functionality all in
one place, rather than a shared mapper file

* Refactored members controller to return models

Previously the controller was calling toJSON, which is serialization,
this updates the controller to only deal with models, leaving all of the
serialization to the serializer!

* Refactored members serializer

This adds typings to all of the methods/functions in the serializer, as
well as making the serializating explicit, rather than returning the
result of toJSON, we explicitly set the properties we expect to be on
the output object. This protects us against accidental API changes in
the future.
2020-09-30 10:22:22 +01:00
..
client@a80e2681f1 Updated Ghost-Admin to v3.34.1 2020-09-24 19:26:52 +01:00
frontend Renamed membersjs script name to portal 2020-09-24 12:08:51 +05:30
server Ensured Admin API members resource only returns known fields (#12240) 2020-09-30 10:22:22 +01:00
shared Added support for Stripe promo codes in config (#12149) 2020-09-21 13:15:41 +01:00
index.js Refactored server announce functions to be clearer 2020-08-09 17:25:15 +01:00