Added buyer seller bolean
This commit is contained in:
@@ -36,8 +36,8 @@ func SaveResetTokenToDB(userID uint, resetToken string) error {
|
||||
func GetUserByEmail(email string) (*models.User, error) {
|
||||
var user models.User
|
||||
|
||||
// Query the database for a user with the specified email
|
||||
if err := shared.GetDb().Where("email = ?", email).First(&user).Error; err != nil {
|
||||
// Query the database for a user with the specified email and preload Companies
|
||||
if err := shared.GetDb().Preload("Companies").Where("email = ?", email).First(&user).Error; err != nil {
|
||||
if gorm.IsRecordNotFoundError(err) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user