Ghost/ghost/members-api
Naz 93a10d8f4f Optimized queries for tiers (aka products)
refs https://github.com/TryGhost/Toolbox/issues/515
refs dd4d6aeae5

- The `productRepository.list` call produced 5 db queries and a transaction wrapping this call.
- Transaction is not needed in this situation as there are no possible writes in the meantime (transaction wrapping code was put in there through refed commit to guard against failing Stripe API calls, which are no longer involved when calling the list method)
-  The `limit: 'all'` makes sure all product entries are fetched AND removes an extra aggregation query called over stripe_prices join
- The 'monthlyPrice' and 'yearlyPrice' relations are not needed because this data is not used in downstream code - only slug and type are used for visiblity/content gating  (ref. 1 3b6759ca6d/ghost/core/core/server/services/members/content-gating.js (L44-L55), ref. 2 3b6759ca6d/ghost/core/core/server/api/endpoints/utils/serializers/output/mappers/posts.js (L39-L54))
2023-02-09 13:07:57 +08:00
..
lib Optimized queries for tiers (aka products) 2023-02-09 13:07:57 +08:00
test 🐛 Fixed broken redemption count for offers (#15954) 2022-12-07 14:30:11 +05:30
.eslintrc.js Removed trailing commas from .eslintrc.js 2021-07-14 12:04:46 +01:00
index.js Fixed index.js require 2021-07-15 18:06:45 +01:00
package.json Added version information to log lines 2023-01-20 13:18:44 +01:00