From a18674ce5f201e55fd742778719cf7af86219951 Mon Sep 17 00:00:00 2001 From: Nabil Ould Hamou Date: Fri, 1 Mar 2024 23:43:38 +0100 Subject: [PATCH] fix: bug --- controllers/userController.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/userController.go b/controllers/userController.go index ea67416..636a45f 100644 --- a/controllers/userController.go +++ b/controllers/userController.go @@ -61,7 +61,7 @@ func GetUserById(c *gin.Context) { } var user models.User - result := initializers.DB.Preload("Posts").First(&user, "id = ?", uniqueId) + result := initializers.DB.Preload("Posts").Preload("Files").First(&user, "id = ?", uniqueId) if result.Error != nil { if errors.Is(result.Error, gorm.ErrRecordNotFound) {