API: Joins / Relations refactor
ErisDS opened this issue · 2 comments
ErisDS commented
This issue is a little bit of a mixed bag, I needed to brain dump all of the small join / relation related tasks that need to be done to ensure we get consistent behaviour across the API.
Joins / Relation handling
- Move all the handling of joins / relations into one place:
- Posts: tags, author
- Tags: posts
- Users: posts, roles
- Make it possible to use joins in
fields
Count handling
- Change
post_count
include on Tag endpoint to beposts.count
- Add
tags.count
to Posts endpoint andposts.count
to Users endpoint
Perms & Cleanup
- Once public endpoint perms are in place properly (#5614) ensure that the inclusion of Posts adheres to the same policy
- Once public endpoint perms are in place properly (#5614) ensure that the inclusion of counts adheres to the same policy
- Overhaul next & previous post implementation so that it is possible to include
next.tags
andnext.author
etc (fix #5150) - Once the filter parameter is in place (#5604), get rid of the tag & author parameters for posts, and the role parameters for users.
Provide access to more joins / relations:
- Users by role
Maybe:
- Allow for include of Posts from Tag or User endpoints
- Consider adding support for relations between users and tags through posts, e.g. listing tags for an author, or listing authors for a tag - although this is probably something for a later version.