From 64b947d455641c13454f33f18d347b622729a519 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 27 May 2020 17:14:38 +0300 Subject: [PATCH] Change invitations to also follow our list return type format. --- django_etesync/views.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/django_etesync/views.py b/django_etesync/views.py index dfc0274..235d378 100644 --- a/django_etesync/views.py +++ b/django_etesync/views.py @@ -123,6 +123,17 @@ class BaseViewSet(viewsets.ModelViewSet): return queryset, new_stoken + # Change how our list works by default + def list(self, request, collection_uid=None): + queryset = self.get_queryset() + serializer = self.get_serializer(queryset, many=True) + + ret = { + 'data': serializer.data, + } + + return Response(ret) + class CollectionViewSet(BaseViewSet): allowed_methods = ['GET', 'POST', 'DELETE']