File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
functions/technologies/libs Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 12
12
13
13
def list_data (params ):
14
14
onlyname = False
15
- ref = DB .collection (u 'technologies' )
15
+ ref = DB .collection ('technologies' )
16
16
17
17
query = ref
18
18
@@ -26,14 +26,20 @@ def list_data(params):
26
26
27
27
query = query .where (filter = or_filter )
28
28
29
-
30
29
if 'category' in params :
31
30
params_array = convert_to_array (params ['category' ])
32
31
query = query .where (filter = FieldFilter ('category_obj' , 'array_contains_any' , params_array ))
33
32
34
33
if 'onlyname' in params :
35
34
onlyname = True
36
35
36
+ if 'sort' not in params :
37
+ query = query .order_by ('technology' , direction = firestore .Query .ASCENDING )
38
+ else :
39
+ if params ['sort' ] == 'origins' :
40
+ query = query .order_by ('origins' , direction = firestore .Query .DESCENDING )
41
+
42
+
37
43
documents = query .stream ()
38
44
39
45
data = []
You can’t perform that action at this time.
0 commit comments