MCPcopy Index your code
hub / github.com/dnote/dnote / GetUserByEmail

Method GetUserByEmail

pkg/server/app/users.go:107–117  ·  view source on GitHub ↗

GetUserByEmail finds a user by email

(email string)

Source from the content-addressed store, hash-verified

105
106// GetUserByEmail finds a user by email
107func (a *App) GetUserByEmail(email string) (*database.User, error) {
108 var user database.User
109 err := a.DB.Where("email = ?", email).First(&user).Error
110 if errors.Is(err, gorm.ErrRecordNotFound) {
111 return nil, ErrNotFound
112 } else if err != nil {
113 return nil, err
114 }
115
116 return &user, nil
117}
118
119// GetAllUsers retrieves all users from the database
120func (a *App) GetAllUsers() ([]database.User, error) {

Callers 5

AuthenticateMethod · 0.95
RemoveUserMethod · 0.95
userRemoveCmdFunction · 0.80
userResetPasswordCmdFunction · 0.80
TestGetUserByEmailFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestGetUserByEmailFunction · 0.64