♻️(backend) add more doc sorting

Update the viewset to be able to sort by:
- created date
- updated date
- title
This commit is contained in:
Anthony LC
2024-07-04 12:02:31 +02:00
committed by Anthony LC
parent 35852dff0b
commit 6b8af1f9ec
2 changed files with 151 additions and 14 deletions

View File

@@ -160,7 +160,7 @@ class ResourceViewsetMixin:
"""Mixin with methods common to all resource viewsets that are managed with accesses."""
filter_backends = [filters.OrderingFilter]
ordering_fields = ["created_at"]
ordering_fields = ["created_at", "updated_at", "title"]
ordering = ["-created_at"]
def get_queryset(self):