fix(module_2_filter):fixed order by latest

This commit is contained in:
bobbyvish
2024-07-12 16:00:22 +05:30
parent 23bae8cf3d
commit 91dba0308c

View File

@@ -1010,7 +1010,7 @@ class EventListView(generics.ListAPIView):
# Replace 'latest' with '-created_on' in the ordering fields
ordering = ",".join(
"-created_on" if field == "latest" else f"-{field}"
"-start_date" if field == "latest" else f"-{field}"
for field in ordering_fields
)
# Apply the ordering to the queryset