(contacts) add "abilities" to API endpoint data

Returns the possible actions to the frontend using the
model's `get_abilities`.
This commit is contained in:
Quentin BEY
2024-12-06 11:57:58 +01:00
committed by BEY Quentin
parent 7154a491f4
commit 6fde76fb46
8 changed files with 37 additions and 14 deletions

View File

@@ -137,7 +137,7 @@ class ContactViewSet(
"""Contact ViewSet"""
permission_classes = [permissions.AccessPermission]
queryset = models.Contact.objects.all()
queryset = models.Contact.objects.select_related("user").all()
serializer_class = serializers.ContactSerializer
throttle_classes = [BurstRateThrottle, SustainedRateThrottle]
ordering_fields = ["full_name", "short_name", "created_at"]