Commit a7345e36 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix gravatar size and update docs for new users API

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent ae564c97
......@@ -487,7 +487,7 @@ class User < ActiveRecord::Base
if avatar.present?
URI::join(Gitlab.config.gitlab.url, avatar.url).to_s
else
GravatarService.new.execute(email)
GravatarService.new.execute(email, size)
end
end
end
......@@ -6,6 +6,34 @@ Get a list of users.
This function takes pagination parameters `page` and `per_page` to restrict the list of users.
### For normal users:
```
GET /users
```
```json
[
{
"id": 1,
"username": "john_smith",
"name": "John Smith",
"state": "active",
"avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg",
},
{
"id": 2,
"username": "jack_smith",
"name": "Jack Smith",
"state": "blocked",
"avatar_url": "http://gravatar.com/../e32131cd8.jpeg",
}
]
```
### For admins:
```
GET /users
```
......@@ -29,6 +57,7 @@ GET /users
"theme_id": 1,
"color_scheme_id": 2,
"is_admin": false,
"avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg",
"can_create_group": true
},
{
......@@ -48,6 +77,7 @@ GET /users
"theme_id": 1,
"color_scheme_id": 3,
"is_admin": false,
"avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg",
"can_create_group": true,
"can_create_project": true
}
......@@ -62,6 +92,29 @@ Also see `def search query` in `app/models/user.rb`.
Get a single user.
#### For user:
```
GET /users/:id
```
Parameters:
- `id` (required) - The ID of a user
```json
{
"id": 1,
"username": "john_smith",
"name": "John Smith",
"state": "active",
"avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg",
}
```
#### For admin:
```
GET /users/:id
```
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment