app/controllers/v1/users_controller.rb
# Get all Users function
# query param to find a user with STR include no sensitive
#
# Return Users with only id, github_login and github_html_url with ok 200 code
#     if param query expand is resources return all data with ok 200 code
# Return a no_content 204 if there isn't any record
#
# users?query=<value> get users login include value
  @api {get} /users Request user index
  @apiVersion 1.0.0
  @apiName GetUsers
  @apiPermission none
  @apiGroup Users
  @apiSuccess {Object} data
  @apiSuccess {Object[]} data.user User data
  @apiSuccess {String} data.user.github_id ID of user in source control
  @apiSuccess {String} data.user.login Login
  @apiSuccess {String} data.user.url_profile Url of the profile in source control
  @apiUse Pagination
  @apiUse NoContent
  @apiSuccessExample {json} Success
{
    "data": [
        {
            "github_id": "7500590",
            "login": "chargio",
            "url_profile": "https://github.com/chargio"
        }
    ],
    "meta": {
        "current_page": 1,
        "total_pages": 1,
        "total_count": 1
    }
}
Get all Users function
query param to find a user with STR include no sensitive

Return Users with only id, github_login and github_html_url with ok 200 code
if param query expand is resources return all data with ok 200 code
Return a no_content 204 if there isn't any record


Get all Users function query param to find a user with STR include no sensitive Return Users with only id github_login and github_html_url with ok 200 code if param query expand is resources return all data with ok 200 code Return a no_content 204 if there isn ' t any record
def index
      logger.debug 'Providing all users'
      @users = User.all 
      @users = @users.where("'github_login' ILIKE ? ", "%#{params[:query]}%") if params[:query]
      @users = @users.order("#{params[:sort]} #{params[:order] || 'DESC'}") if params[:sort]
      if @users.count.positive?
        return_response @users, :ok
      else
        render status: :no_content
      end
    end
def index logger . debug 'Providing all users' @users = User . all @users = @users . where ( "'github_login' ILIKE ? " , "%#{params[:query]}%" ) if params [ :query ] @users = @users . order ( "#{params[:sort]} #{params[:order] || 'DESC'}" ) if params [ :sort ] if @users . count . positive? return_response @users , :ok else render status : :no_content end end
Get all Users function
query param to find a user with STR include no sensitive
Get all Users function query param to find a user with STR include no sensitive
# TODO: Pagination # render json: @users, expand: params[:expand] == "resources",status: :ok