mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
API: Add createdAt field to /api/users/:id (#19475)
It would help for auditing purposes to have the user's created date exposed via the API along with the other fields already exposed via the API.
This commit is contained in:
parent
3c0976afab
commit
e1b2bf711d
@ -35,6 +35,7 @@ func TestUserApiEndpoint(t *testing.T) {
|
||||
IsDisabled: false,
|
||||
IsExternal: false,
|
||||
UpdatedAt: fakeNow,
|
||||
CreatedAt: fakeNow,
|
||||
}
|
||||
return nil
|
||||
})
|
||||
@ -63,7 +64,8 @@ func TestUserApiEndpoint(t *testing.T) {
|
||||
"authLabels": [
|
||||
"LDAP"
|
||||
],
|
||||
"updatedAt": "2019-02-11T17:30:40Z"
|
||||
"updatedAt": "2019-02-11T17:30:40Z",
|
||||
"createdAt": "2019-02-11T17:30:40Z"
|
||||
}
|
||||
`
|
||||
|
||||
|
@ -226,6 +226,7 @@ type UserProfileDTO struct {
|
||||
IsExternal bool `json:"isExternal"`
|
||||
AuthLabels []string `json:"authLabels"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
type UserSearchHitDTO struct {
|
||||
|
@ -332,6 +332,7 @@ func GetUserProfile(query *models.GetUserProfileQuery) error {
|
||||
IsDisabled: user.IsDisabled,
|
||||
OrgId: user.OrgId,
|
||||
UpdatedAt: user.Updated,
|
||||
CreatedAt: user.Created,
|
||||
}
|
||||
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user