GetByID returns a user by ID.
(ctx context.Context, id string)
| 24 | |
| 25 | // GetByID returns a user by ID. |
| 26 | func (s *UsersStore) GetByID(ctx context.Context, id string) (*models.User, error) { |
| 27 | d := s.db.DB(ctx) |
| 28 | u, err := d.Queries.GetUserByID(ctx, id) |
| 29 | if err != nil { |
| 30 | return nil, err |
| 31 | } |
| 32 | out := dbUserToModel(u) |
| 33 | return &out, nil |
| 34 | } |
| 35 | |
| 36 | // GetByUsername returns a user by username (case-insensitive). |
| 37 | func (s *UsersStore) GetByUsername(ctx context.Context, username string) (*models.User, error) { |
no test coverage detected