(ctx context.Context, email string)
| 81 | } |
| 82 | |
| 83 | func (s *UserService) GetUserByEmail(ctx context.Context, email string) (*models.User, error) { |
| 84 | result := s.userCollection.FindOne(ctx, bson.M{"email": email}) |
| 85 | if result.Err() != nil { |
| 86 | return nil, result.Err() |
| 87 | } |
| 88 | |
| 89 | var user models.User |
| 90 | if err := result.Decode(&user); err != nil { |
| 91 | return nil, err |
| 92 | } |
| 93 | |
| 94 | return &user, nil |
| 95 | } |
| 96 | |
| 97 | func (s *UserService) GetUserSettings(ctx context.Context, userID bson.ObjectID) (*models.Settings, error) { |
| 98 | user, err := s.GetUserByID(ctx, userID) |