Skip to content
Snippets Groups Projects
Commit 459adadb authored by DALLEL Mohamed's avatar DALLEL Mohamed
Browse files

Merge branch 'add-order_by-and-upcoming-events' into 'main'

add order_by and only upcoming events filter

See merge request !15
parents 636ab78e 95ccfd6e
No related branches found
No related tags found
1 merge request!15add order_by and only upcoming events filter
Pipeline #20244 passed
......@@ -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