blezz-tech 3 өдөр өмнө
parent
commit
29eefc3b56
1 өөрчлөгдсөн 10 нэмэгдсэн , 2 устгасан
  1. 10 2
      api/v2/views/tickets.py

+ 10 - 2
api/v2/views/tickets.py

@@ -10,11 +10,11 @@ class TicketPatchAPIView(generics.UpdateAPIView):
     API для частичного обновления тикета
     """
 
+    queryset = Ticket.objects.all()
     serializer_class = TicketSerializer
     permission_classes = [
         permissions.IsAuthenticated | HasAPIKey
     ]
-    queryset = Ticket.objects.all()
 
 
 class TicketListAPIView(generics.ListAPIView):
@@ -22,9 +22,17 @@ class TicketListAPIView(generics.ListAPIView):
     API для получения списка тикетов
     """
 
+    queryset = Ticket.objects.all()
     serializer_class = TicketSerializer
     permission_classes = [
         permissions.IsAuthenticated | HasAPIKey
     ]
-    queryset = Ticket.objects.all()
+    filterset_fields = (
+        'title',
+        'ticket_list',
+        'ticket_type',
+        'status',
+        'created_by',
+        'assigned_to',
+    )