mirror of
https://github.com/grafana/grafana.git
synced 2024-12-01 04:59:15 -06:00
Merge pull request #3254 from utkarshcmu/user-id
/api/admin/users returns user ID in JSON response
This commit is contained in:
commit
a56f657fb1
@ -1388,7 +1388,7 @@ Create new user
|
||||
HTTP/1.1 200
|
||||
Content-Type: application/json
|
||||
|
||||
{"message":"User created"}
|
||||
{"id":5,"message":"User created"}
|
||||
|
||||
### Password for User
|
||||
|
||||
|
@ -37,7 +37,14 @@ func AdminCreateUser(c *middleware.Context, form dtos.AdminCreateUserForm) {
|
||||
|
||||
metrics.M_Api_Admin_User_Create.Inc(1)
|
||||
|
||||
c.JsonOK("User created")
|
||||
user := cmd.Result
|
||||
|
||||
result := m.UserIdDTO{
|
||||
Message: "User created",
|
||||
Id: user.Id,
|
||||
}
|
||||
|
||||
c.JSON(200, result)
|
||||
}
|
||||
|
||||
func AdminUpdateUserPassword(c *middleware.Context, form dtos.AdminUpdateUserPasswordForm) {
|
||||
|
@ -157,3 +157,8 @@ type UserSearchHitDTO struct {
|
||||
Email string `json:"email"`
|
||||
IsAdmin bool `json:"isAdmin"`
|
||||
}
|
||||
|
||||
type UserIdDTO struct {
|
||||
Id int64 `json:"id"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user