Create new API endpoint to display the user's reach and contributions
What does this MR do and why?
Create new API endpoint (/users/:user_id/associations_count
) to return the list of a specified user's count of projects, groups, issues and merge requests.
This new API can be used by administrators to get a list of any users' association count but only returns the current users' data for non-admin users.
How to set up and validate locally
- Using Postman, add the URL:
http://localhost:3000/api/v4/users/3/associations_count
- Add Cookie in the headers section
- Make the API request
- Verify that the response is in the following format:
{
"groups_count": 9,
"projects_count": 9,
"issues_count": 68,
"merge_requests_count": 17
}
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #372878 (closed)
Edited by Mansoor Khan