mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
add min_posts, max_posts to filter the topic list queries
superseeds #2412
This commit is contained in:
@@ -13,6 +13,8 @@ class TopicQuery
|
||||
limit
|
||||
page
|
||||
per_page
|
||||
min_posts
|
||||
max_posts
|
||||
topic_ids
|
||||
visible
|
||||
category
|
||||
@@ -266,6 +268,9 @@ class TopicQuery
|
||||
end
|
||||
end
|
||||
|
||||
result = result.where('topics.posts_count <= ?', options[:max_posts]) if options[:max_posts].present?
|
||||
result = result.where('topics.posts_count >= ?', options[:min_posts]) if options[:min_posts].present?
|
||||
|
||||
guardian = Guardian.new(@user)
|
||||
if !guardian.is_admin?
|
||||
allowed_ids = guardian.allowed_category_ids
|
||||
|
||||
Reference in New Issue
Block a user