Skip to content

Commit

Permalink
edit userDescDB name models
Browse files Browse the repository at this point in the history
  • Loading branch information
fchrgrib committed Jun 10, 2023
1 parent f2f2024 commit 8790051
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/register/AuthGoogle.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
func CreateUserAuthGoogle(c *gin.Context) {
var (
userDesc models.UserDescDB
justCheck models.UserDescDB
userPhotoProfile models.UserPhotoProfileDB
googleToken models.GoogleToken
)
Expand Down Expand Up @@ -68,7 +69,7 @@ func CreateUserAuthGoogle(c *gin.Context) {
PhoneNumber: "",
}

if err := db.Table("user").Where("email = ?", user.Email).First(&models.UserDescDB{}).Error; err == nil {
if _ = db.Table("user").Where("email = ?", user.Email).First(&justCheck); justCheck.Email != "" {
c.JSON(http.StatusBadRequest, gin.H{
"status": "cannot create new user because email was existed",
})
Expand Down

3 comments on commit 8790051

@vercel
Copy link

@vercel vercel bot commented on 8790051 Jun 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 8790051 Jun 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 8790051 Jun 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.