-
Notifications
You must be signed in to change notification settings - Fork 0
GET endpoint for usersID #59
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
base: main
Are you sure you want to change the base?
Conversation
backend/internal/handler/users.go
Outdated
|
|
||
| } | ||
|
|
||
| func NewUserHandler(repo UsersRepository) *UsersHandler { |
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.
NewUsersHandler
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.
done
backend/internal/repository/devs.go
Outdated
|
|
||
| return devs, nil | ||
| } | ||
|
|
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 we remove this? Or mv it to a separate pr? It's not related to get users
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.
mb this was totally from the bootcamp exercise and I never got rid of it
spokonya
left a comment
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.
Addressed comments:
- removed devs stuff
- Made NewUsersHandler plural
- Fixed naming convention for searching for a user at the db/repository level with "Find" instead of "Get"
| type UsersRepository interface { | ||
|
|
||
| GetUserById(ctx context.Context, id string) (*models.User, error) | ||
| FindUserById(ctx context.Context, id string) (*models.User, 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.
For naming conventions, it's implied that FindT is FindTByid. One of the gotchas in naming that I forgot to mention, if its named findUser, it's implied that the param is the primary key/id unless otherwise stated.
Stuff added:
Closes #45