File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
functions/categories/libs Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,14 @@ def list_data(params):
27
27
category_array = convert_to_array (params ['category' ])
28
28
29
29
for category in category_array :
30
- results = DB . collection ( u'categories' ) .where ("category" , "==" , category ).stream ()
30
+ results = query .where ("category" , "==" , category ).stream ()
31
31
for doc in results :
32
32
data .append (doc .to_dict ())
33
33
34
+ else :
35
+ documents = query .stream ()
36
+
37
+ for doc in documents :
38
+ data .append (doc .to_dict ())
39
+
34
40
return Result (result = data )
Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ def __init__(self, params):
9
9
def validate (self ):
10
10
result = Result (status = "ok" , result = "()" )
11
11
12
- if 'onlyname' not in self .params :
13
- if 'category' not in self .params :
14
- self .add_error ("category" , "missing category parameter" )
12
+ # if 'onlyname' not in self.params:
13
+ # if 'category' not in self.params:
14
+ # self.add_error("category", "missing category parameter")
15
15
16
16
return Result (errors = self .errors , result = self .params )
17
17
You can’t perform that action at this time.
0 commit comments