1
0
mirror of https://github.com/etesync/server synced 2024-12-28 18:28:07 +00:00

CollectionItem: add a batch endpoint for batch operations.

This commit is contained in:
Tom Hacohen 2020-05-19 13:10:50 +03:00
parent 4c7e30eca5
commit f7c66eaadb

View File

@ -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)