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) {