fix: n'envoie pas l'avatar lors du get many
This commit is contained in:
parent
bcdff48057
commit
42fa4d23e0
1 changed files with 2 additions and 2 deletions
|
@ -34,9 +34,9 @@ func GetUsers(c *gin.Context) {
|
|||
var result *gorm.DB
|
||||
|
||||
if username != "" {
|
||||
result = initializers.DB.Where("username LIKE ?", username+"%").Offset(offset).Limit(20).Find(&users)
|
||||
result = initializers.DB.Preload("Avatar").Where("username LIKE ?", username+"%").Offset(offset).Limit(20).Find(&users)
|
||||
} else {
|
||||
result = initializers.DB.Offset(offset).Limit(20).Find(&users)
|
||||
result = initializers.DB.Preload("Avatar").Offset(offset).Limit(20).Find(&users)
|
||||
}
|
||||
|
||||
if result.Error != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue