From 2f99c09bfeead966e8086d1a56aabc3c18cf902e Mon Sep 17 00:00:00 2001 From: Nabil Ould Hamou Date: Sat, 2 Mar 2024 01:34:03 +0100 Subject: [PATCH] fix: bug --- controllers/authController.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/authController.go b/controllers/authController.go index e2a4442..68c8e24 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.First(&user, "email = ?", body.Email) + result := initializers.DB.Preload("Posts.Files").First(&user, "email = ?", body.Email) if result.Error != nil { if errors.Is(result.Error, gorm.ErrRecordNotFound) {