diff --git a/internal/postgres/user.go b/internal/postgres/user.go index d6c3769..3cf9fb8 100644 --- a/internal/postgres/user.go +++ b/internal/postgres/user.go @@ -252,7 +252,7 @@ func GetUserFavoriteWithPagination(ctx context.Context, db *gorm.DB, anthroveUse for _, userFavorite := range userFavorites { var post models.Post - err = db.WithContext(ctx).Model(&models.Post{}).Where("id = ?", userFavorite.PostID).First(&post).Error + err = db.WithContext(ctx).Model(&models.Post{}).Joins("References").Where("id = ?", userFavorite.PostID).First(&post).Error if err != nil { if errors.Is(err, gorm.ErrRecordNotFound) { return nil, &otterError.NoDataFound{}