Skip to content

Commit 8ea3b44

Browse files
committed
categories filter no mandatory
1 parent 39b9f19 commit 8ea3b44

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

functions/categories/libs/queries.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,14 @@ def list_data(params):
2727
category_array = convert_to_array(params['category'])
2828

2929
for category in category_array:
30-
results = DB.collection(u'categories').where("category", "==", category).stream()
30+
results = query.where("category", "==", category).stream()
3131
for doc in results:
3232
data.append(doc.to_dict())
3333

34+
else:
35+
documents = query.stream()
36+
37+
for doc in documents:
38+
data.append(doc.to_dict())
39+
3440
return Result(result=data)

functions/categories/libs/validator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ def __init__(self, params):
99
def validate(self):
1010
result = Result(status="ok", result="()")
1111

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")
1515

1616
return Result(errors=self.errors, result=self.params)
1717

0 commit comments

Comments
 (0)