-
Notifications
You must be signed in to change notification settings - Fork 111
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
Add username to get account #265
base: main
Are you sure you want to change the base?
Add username to get account #265
Conversation
type AccountGetterParams struct { | ||
AccountID *int | ||
Username *string | ||
} | ||
|
||
func AccountGetter(store data.AccountStore, params AccountGetterParams) (*models.Account, error) { |
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.
Haven't seen structs used for params, so let me know if this should be changed
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.
Hi @ahme-dev, thanks for your patience. This looks good! I have one small question before I'm ready to approve.
if err != nil { | ||
if _, ok := err.(services.FieldErrors); ok { | ||
WriteNotFound(w, "account") |
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.
Can you say more about this change? I'm not sure how it's related.
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.
I've commited it by mistake, re-adding now. Let me know if there's anything else
Adds the ability to get an account by username, alongside the normal id. As discussed in #264