fix(module_2_filter):fixed order by latest
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user