feat(api): add API_GetUserSetRequests#2950
Conversation
wescopeland
left a comment
There was a problem hiding this comment.
Hi @drisc!
Thanks for opening this PR! I've briefly scanned over the implementation and left one comment for you to chew on 🙂
Once it's resolved, I'm happy to do a deeper dive into the patchset implementation details.
In the meantime, I will be temporarily moving this PR to draft. From our latest contributing requirements, any API changes require a sister PR in api-docs. An example of a good one can be found at RetroAchievements/api-docs#68!
Once an api-docs PR is opened, please feel free to move this PR out of draft! Thanks for your understanding 🙏
| ->where('type', 'achievement_set_request') | ||
| ->orderBy('GameData.sort_title') | ||
| ->get() | ||
| ->toArray(); |
There was a problem hiding this comment.
I just noticed that this is returning completed requests (i.e. the list returned when clicking on "View All User Set Requests"). It should probably only return active requests (where GameData.achievements_published = 0)
Is there any reason we'd want to expose the completed requests? If so, we might want a flag for doing so.
There was a problem hiding this comment.
The site page allows for viewing all past requests as well so adding a flag for it would be my vote. That way the endpoint can get a list of all a users requests if needed.
There was a problem hiding this comment.
Type flag added in latest, I've also updated and added a test to check for achievements_published.

This PR adds an endpoint to fetch the current set request list of a user along with their total request count and the amount of points they need to unlock their next request.