From bcdff480575303ab4cff4312469924b7e3e7920c Mon Sep 17 00:00:00 2001 From: Nabil Ould Hamou Date: Thu, 7 Mar 2024 05:04:26 +0100 Subject: [PATCH] fix: n'envoie pas l'avatar lors de la connexion --- controllers/authController.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/authController.go b/controllers/authController.go index 68c8e24..3b79b75 100644 --- a/controllers/authController.go +++ b/controllers/authController.go @@ -83,7 +83,7 @@ func Login(c *gin.Context) { } 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 errors.Is(result.Error, gorm.ErrRecordNotFound) {