Skip to content
Snippets Groups Projects
Commit 95ccfd6e authored by moDall's avatar moDall
Browse files

add order_by and only upcoming events filter

parent 636ab78e
No related branches found
No related tags found
1 merge request!15add order_by and only upcoming events filter
Pipeline #20243 failed
......@@ -70,8 +70,15 @@ def get_filtered_events():
# Get the JSON data from the request body
filters = request.json.get('filters', {})
# Build the API query parameters based on the provided filters
query_params = [('offset', offset), ('limit', limit)]
body = request.json
print(body)
if (body["order_by"]) :
query_params.append(('order_by', body["order_by"]))
if (body["only_upcoming_events"]) :
query_params.append(('where', 'date >= now()'))
for filter in filters:
for filter_name, filter_values in filter.items():
for filter_value in filter_values:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment