feat: add count to get users endpoint (#5016)

This commit is contained in:
Garrett Delfosse
2022-11-14 17:22:57 -05:00
committed by GitHub
parent 49b340e039
commit 88f3691dcc
25 changed files with 425 additions and 483 deletions

View File

@ -71,3 +71,25 @@ func (User) RBACObject() rbac.Object {
func (License) RBACObject() rbac.Object {
return rbac.ResourceLicense
}
func ConvertUserRows(rows []GetUsersRow) []User {
users := make([]User, len(rows))
for i, r := range rows {
users[i] = User{
ID: r.ID,
Email: r.Email,
Username: r.Username,
HashedPassword: r.HashedPassword,
CreatedAt: r.CreatedAt,
UpdatedAt: r.UpdatedAt,
Status: r.Status,
RBACRoles: r.RBACRoles,
LoginType: r.LoginType,
AvatarURL: r.AvatarURL,
Deleted: r.Deleted,
LastSeenAt: r.LastSeenAt,
}
}
return users
}