Added buyer seller bolean

This commit is contained in:
Nedim
2023-11-15 16:16:44 +01:00
parent d7f79c51c3
commit 903da29fed
5 changed files with 25 additions and 10 deletions

View File

@@ -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
}