Ghost/ghost/custom-theme-settings-service
Simon Backx 82a3133ace
Added replies/likes count and limited replies to comments (#15206)
refs https://github.com/TryGhost/Team/issues/1723

- Added count.replies to comments
- Added replies endpoint
- Limited returned replies to 3.
- Replaced likes_count with count.likes in comments
- Instead of fetching all the likes of a comment to determine the total count, we'll now use count.likes
- Instead of fetching all the likes of a comment to determine whether a member liked a comment, we'll now use count.liked (which returns the amount of likes of the current member, being 0 or 1). This is mapped to `liked` to make it more natural to work with.

The `members.test.snap` file changed because we no longer include `liked: false` if we didn't fetch the liked relation. And in the comments events of the activity feed the liked property is therefore removed.

These changes requires an update to the `bookshelf-include-count` plugin:
- Updated to also work for nested relations
- This moves the count queries from the `bookshelf-include-count` plugin to the `countRelations` method of each model.
- Updated to keep the counts after saving a model (crud.edit didn't return the counts before)
2022-08-10 16:12:35 +02:00
..
lib Added guard for activateTheme being called in parallel causing sync bugs (#15053) 2022-08-04 11:29:58 +01:00
test Added guard for activateTheme being called in parallel causing sync bugs (#15053) 2022-08-04 11:29:58 +01:00
.eslintrc.js slimer new custom-theme-settings-service 2021-09-21 17:21:52 +01:00
index.js First pass at custom-theme-settings-service functionality 2021-09-22 21:56:45 +01:00
package.json Added replies/likes count and limited replies to comments (#15206) 2022-08-10 16:12:35 +02:00