From f7c66eaadb0842386548ee6a9910e2e228094931 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 19 May 2020 13:10:50 +0300 Subject: [PATCH] CollectionItem: add a batch endpoint for batch operations. --- django_etesync/views.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/django_etesync/views.py b/django_etesync/views.py index 24b62fa..c905a54 100644 --- a/django_etesync/views.py +++ b/django_etesync/views.py @@ -232,6 +232,11 @@ class CollectionItemViewSet(BaseViewSet): } return Response(ret, headers={'X-EteSync-SToken': new_stoken}) + @action_decorator(detail=False, methods=['POST']) + def batch(self, request, collection_uid=None): + # FIXME: different to transaction slightly + return self.transaction(request, collection_uid) + @action_decorator(detail=False, methods=['POST']) def transaction(self, request, collection_uid=None): collection_object = get_object_or_404(self.get_collection_queryset(Collection.objects), uid=collection_uid)