diff --git a/arkindex/documents/api/elements.py b/arkindex/documents/api/elements.py index 1afd478b6f0eb2a2a56d71268d5cfe988a383d13..565a79115abb5308d71cc9331a688bb909865be5 100644 --- a/arkindex/documents/api/elements.py +++ b/arkindex/documents/api/elements.py @@ -1170,6 +1170,7 @@ class ElementBulkCreate(CreateAPIView): return [{'id': element_data['element'].id} for element_data in elements] +<<<<<<< HEAD class CorpusDeleteSelection(SelectionMixin, DestroyAPIView): """ Delete all selected elements on a corpus @@ -1194,3 +1195,14 @@ class CorpusDeleteSelection(SelectionMixin, DestroyAPIView): element_trash(queryset, user_id=self.request.user.id) return Response(status=status.HTTP_204_NO_CONTENT) +======= +class CorpusDeleteSelection(ElementsListMixin, SelectionMixin, DestroyAPIView): + """ + Delete selected elements on a corpus + """ + + def get_queryset(self): + # Should not be possible due to the URL + assert self.selected_corpus, 'Missing corpus ID' + return self.get_selection(corpus_id=self.selected_corpus.id) +>>>>>>> Start working on selected elements deletion diff --git a/arkindex/project/api_v1.py b/arkindex/project/api_v1.py index 57749b163d19b599b2caff666db09a81ebd7ac66..83657676ad56715636a87806b7c948361c924329 100644 --- a/arkindex/project/api_v1.py +++ b/arkindex/project/api_v1.py @@ -145,7 +145,11 @@ api = [ path('corpus/<uuid:pk>/ml-stats/', CorpusMLStats.as_view(), name='corpus-ml-stats'), path('corpus/<uuid:pk>/allowed-metadata/', CorpusAllowedMetaData.as_view(), name='corpus-allowed-metadata'), path('corpus/<uuid:pk>/versions/', CorpusWorkerVersionList.as_view(), name='corpus-versions'), +<<<<<<< HEAD path('corpus/<uuid:pk>/selection/', CorpusDeleteSelection.as_view(), name='corpus-delete-selection'), +======= + path('corpus/<uuid:corpus>/selection/', CorpusDeleteSelection.as_view(), name='corpus-delete-selection'), +>>>>>>> Start working on selected elements deletion # Moderation path('ml-classes/', MLClassList.as_view(), name='mlclass-list'),