This commit is contained in:
Nabil Ould Hamou 2024-03-01 23:43:38 +01:00
parent c7d0b3456d
commit a18674ce5f
No known key found for this signature in database
GPG key ID: 2B1AE73E9B6014EF

View file

@ -61,7 +61,7 @@ func GetUserById(c *gin.Context) {
} }
var user models.User 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 result.Error != nil {
if errors.Is(result.Error, gorm.ErrRecordNotFound) { if errors.Is(result.Error, gorm.ErrRecordNotFound) {