This commit is contained in:
Nabil Ould Hamou 2024-03-02 01:34:03 +01:00
parent f4106e156f
commit 2f99c09bfe
No known key found for this signature in database
GPG key ID: 2B1AE73E9B6014EF

View file

@ -83,7 +83,7 @@ func Login(c *gin.Context) {
} }
var user models.User var user models.User
result := initializers.DB.First(&user, "email = ?", body.Email) result := initializers.DB.Preload("Posts.Files").First(&user, "email = ?", body.Email)
if result.Error != nil { if result.Error != nil {
if errors.Is(result.Error, gorm.ErrRecordNotFound) { if errors.Is(result.Error, gorm.ErrRecordNotFound) {