fix: bug lors d'un get users
This commit is contained in:
parent
fd3c48d418
commit
c7d0b3456d
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.First(&user, "id = ?", uniqueId)
|
result := initializers.DB.Preload("Posts").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