Skip to content

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

  1. Using Postman, add the URL: http://localhost:3000/api/v4/users/3/associations_count
  2. Add Cookie in the headers section
  3. Make the API request
  4. 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.

Related to #372878 (closed)

Edited by Mansoor Khan

Merge request reports

Loading