fix: bug
This commit is contained in:
parent
c7d0b3456d
commit
a18674ce5f
1 changed files with 1 additions and 1 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue