Compare commits

...

2 Commits

2 changed files with 8 additions and 1 deletions

View File

@@ -75,6 +75,13 @@ func ToSanitizedUserDTOs(users []database.User) []SanitizedUserDTO {
return dtos return dtos
} }
type SanitizedUserListDTO struct {
Users []SanitizedUserDTO `json:"users"`
Count int `json:"count"`
Limit int `json:"limit"`
Offset int `json:"offset"`
}
type RegistrationResponseDTO struct { type RegistrationResponseDTO struct {
User UserDTO `json:"user"` User UserDTO `json:"user"`
VerificationSent bool `json:"verification_sent"` VerificationSent bool `json:"verification_sent"`

View File

@@ -47,7 +47,7 @@ func (h *UserHandler) GetUsers(w http.ResponseWriter, r *http.Request) {
} }
userDTOs := dto.ToSanitizedUserDTOs(users) userDTOs := dto.ToSanitizedUserDTOs(users)
responseDTO := dto.UserListDTO{ responseDTO := dto.SanitizedUserListDTO{
Users: userDTOs, Users: userDTOs,
Count: len(userDTOs), Count: len(userDTOs),
Limit: limit, Limit: limit,