return everything when searching for empty string

This commit is contained in:
Sam
2021-02-23 12:17:30 +00:00
parent 31066e80bf
commit cbfbfb93f3
2 changed files with 28 additions and 1 deletions

View File

@@ -176,7 +176,10 @@ def product_search(request):
return Response({"errors": {"details": "No query string to parse"}})
elif query_string is '':
# return everything
pass
serializer = ProductSerializer(Product.objects.all(), many=True)
products = serializer.data
# filters = extract_search_filters(products)
return Response(data={"filters": [], "count": len(products), "products": products})
try:
# we collect our results here
result_set = set()