mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 05:14:12 +03:00
c19d282a51
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. |
||
---|---|---|
.. | ||
adapters | ||
api | ||
data | ||
lib | ||
models | ||
public | ||
services | ||
translations | ||
views | ||
web | ||
analytics-events.js | ||
ghost-server.js | ||
index.js | ||
overrides.js | ||
update-check.js |