Fix pagination errors
This commit is contained in:
parent
df8633e35c
commit
786954e35b
|
|
@ -374,10 +374,11 @@ class SiteFeedAnnc
|
|||
pipeline_to_get_data << {"$sort"=>sort_maps}
|
||||
end
|
||||
|
||||
if max_len > 0
|
||||
if max_len > 0 && tags.blank? && hashtags.blank?
|
||||
pipeline_to_get_data << {"$limit"=> max_len}
|
||||
end
|
||||
|
||||
|
||||
pipeline_to_get_count = pipeline.clone
|
||||
pipeline_to_get_count << {"$group" => {
|
||||
_id: nil,
|
||||
|
|
@ -412,6 +413,7 @@ class SiteFeedAnnc
|
|||
if (tags.present? && tags != "all") || (hashtags.present? && hashtags != "all")
|
||||
feeds = feeds.uniq { |f| f['id'] }
|
||||
feeds_count = feeds.size
|
||||
feeds = feeds.first(max_len) if max_len > 0
|
||||
end
|
||||
|
||||
return feeds, feeds_count
|
||||
|
|
|
|||
Loading…
Reference in New Issue