mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Support comma seperated value in order filter for /filter route (#21318)
This allows multiple ordering to be specified by using a comma seperated string. For example, `order:created,views` would order the topics by `Topic#created_at` and then `Topic#views.
This commit is contained in:
committed by
GitHub
parent
93f7c24240
commit
691b9fb919
@@ -132,6 +132,8 @@ class TopicsFilter
|
||||
"posters-min", "posters-max", "views-min", "views-max"
|
||||
value = values.last
|
||||
value if value =~ /\A\d+\z/
|
||||
when "order"
|
||||
values.flat_map { |value| value.split(",") }
|
||||
when "created-by"
|
||||
values.flat_map { |value| value.split(",").map { |username| username.delete_prefix("@") } }
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user