-
-
Notifications
You must be signed in to change notification settings - Fork 117
feat(api): add API_GetUserSetRequests #2950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
wescopeland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.