File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change 77require 'stream-chat/channel'
88require 'stream-chat/errors'
99require 'stream-chat/version'
10+ require 'stream-chat/util'
1011
1112module StreamChat
1213 DEFAULT_BLOCKLIST = 'profanity_en_2020_v1'
@@ -166,26 +167,18 @@ def delete_message(message_id)
166167 end
167168
168169 def query_users ( filter_conditions , sort : nil , **options )
169- sort_fields = [ ]
170- sort &.each do |k , v |
171- sort_fields << { "field" : k , "direction" : v }
172- end
173170 params = options . merge ( {
174171 "filter_conditions" : filter_conditions ,
175- "sort" : sort_fields
172+ "sort" : get_sort_fields ( sort )
176173 } )
177174 get ( 'users' , params : { "payload" : params . to_json } )
178175 end
179176
180177 def query_channels ( filter_conditions , sort : nil , **options )
181178 params = { "state" : true , "watch" : false , "presence" : false }
182- sort_fields = [ ]
183- sort &.each do |k , v |
184- sort_fields << { "field" : k , "direction" : v }
185- end
186179 params = params . merge ( options ) . merge ( {
187180 "filter_conditions" : filter_conditions ,
188- "sort" : sort_fields
181+ "sort" : get_sort_fields ( sort )
189182 } )
190183 get ( 'channels' , params : { "payload" : params . to_json } )
191184 end
You can’t perform that action at this time.
0 commit comments