-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace PublicUserType with models.PublicUser type #355
base: refactor/public_user_model
Are you sure you want to change the base?
Conversation
if err != nil { | ||
http.Error(w, "Error retrieving number of users.", http.StatusInternalServerError) | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no errors currently returned by the call to GetNumMarketUsers(bets)
// PublicUserType is a struct for user data that is safe to send to the client for Profiles | ||
type PublicUserType struct { | ||
Username string `json:"username"` | ||
DisplayName string `json:"displayname" gorm:"unique;not null"` | ||
UserType string `json:"usertype"` | ||
InitialAccountBalance int64 `json:"initialAccountBalance"` | ||
AccountBalance int64 `json:"accountBalance"` | ||
PersonalEmoji string `json:"personalEmoji,omitempty"` | ||
Description string `json:"description,omitempty"` | ||
PersonalLink1 string `json:"personalink1,omitempty"` | ||
PersonalLink2 string `json:"personalink2,omitempty"` | ||
PersonalLink3 string `json:"personalink3,omitempty"` | ||
PersonalLink4 string `json:"personalink4,omitempty"` | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these fields are just being re-declared from the model. By making them a component type of the model User, we can access them all together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LTGM, just a lift and shift right?
Yeah, this is just how the changes to the model in #354 are going to be used. |
This PR uses the new PublicUser type from the model in the user handlers.