-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
Add API endpoint for minimal user profile information #2092
Conversation
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.
Thanks for submitting a PR.
Please add tests for any new endpoint.
Also, let's not add new functionality to any Helpers file unless absolutely necessary. We plan on phasing these out soon. As an alternative, perhaps it would just be best for this new functionality to live within the endpoint itself.
#2090 may be a helpful reference. |
Done! Moved the functionality to the endpoint itself and added tests. |
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.
Looks great. A few minor nits.
Should be good now! |
This PR adds a new endpoint to retrieve minimal user profile information -
API_GetUserProfile.php
We use the existing
API_GetUserSummary.php
endpoint to check if a user exists as well as other details like their untracked/tracked status and then pull additional profile information based on that. This results in some unnecessary DB queries as we only really need fields from the main user table. So I propose adding this as a lighter alternative.One argument is accepted -
u
which represents the user's usernameExample output: