mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 01:41:46 +03:00
f3f9e5a2f3
This prepares us to return a DTO rather than BookshelfModel to the serialiser layer. When passing a BookshelfModel, the serialisation layer uses the model to read from when building computed properties. By stripping values out in the toJSON method it means that the DTO will be missing them and the computed properties won't be able to be calculated. Instead we return ALL values to the serialisation layer, and then strip out the ones that weren't requested in the "clean" step. This also inadvertently fixes the issue with `reading_time` requiring the `html` field to be requested, we can now request just `reading_time`, as well as have it included by default. |
||
---|---|---|
.. | ||
__snapshots__ | ||
authors.test.js | ||
key_authentication.test.js | ||
newsletters.test.js | ||
offers.test.js | ||
pages.test.js | ||
posts.test.js | ||
settings.test.js | ||
tags.test.js | ||
tiers.test.js | ||
utils.js |