Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ahme-dev
Copy link

Adds the ability to get an account by username, alongside the normal id. As discussed in #264

@ahme-dev ahme-dev changed the title feat: add account getting by username add username to get account Jan 27, 2025
@ahme-dev ahme-dev changed the title add username to get account Add username to get account Jan 27, 2025
Comment on lines +9 to +14
type AccountGetterParams struct {
AccountID *int
Username *string
}

func AccountGetter(store data.AccountStore, params AccountGetterParams) (*models.Account, error) {
Copy link
Author

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

@ahme-dev ahme-dev marked this pull request as ready for review January 27, 2025 13:54
Copy link
Member

@cainlevy cainlevy left a 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")
Copy link
Member

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.

Copy link
Author

@ahme-dev ahme-dev Feb 5, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants