fix: n'envoie pas l'avatar lors de la connexion

This commit is contained in:
Nabil Ould Hamou 2024-03-07 05:04:26 +01:00
parent 22e5371b30
commit bcdff48057
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.Preload("Posts.Files").First(&user, "email = ?", body.Email) result := initializers.DB.Preload("Avatar").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) {