1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-22 22:39:36 +02:00

client sorting

This commit is contained in:
Sean Morley 2024-07-13 10:48:51 -04:00
parent f5fc2f5add
commit 586ea89785
2 changed files with 7 additions and 7 deletions

View file

@ -90,8 +90,8 @@ class AdventureViewSet(viewsets.ModelViewSet):
if not request.user.is_authenticated:
return Response({"error": "User is not authenticated"}, status=400)
queryset = Adventure.objects.filter(user_id=request.user.id).exclude(type='featured')
queryset = self.apply_sorting(queryset)
return self.paginate_and_respond(queryset, request)
serializer = self.get_serializer(queryset, many=True)
return Response(serializer.data)
def paginate_and_respond(self, queryset, request):
paginator = self.pagination_class()