Skip to content
Snippets Groups Projects
Commit 1896a404 authored by Eva Bardou's avatar Eva Bardou
Browse files

Start working on selected elements deletion

parent 5287b60e
No related branches found
No related tags found
No related merge requests found
......@@ -1168,3 +1168,14 @@ class ElementBulkCreate(CreateAPIView):
])
return [{'id': element_data['element'].id} for element_data in elements]
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)
......@@ -35,6 +35,7 @@ from arkindex.dataimport.api import (
from arkindex.documents.api.admin import ReindexStart
from arkindex.documents.api.elements import (
CorpusAllowedMetaData,
CorpusDeleteSelection,
CorpusElements,
CorpusList,
CorpusRetrieve,
......@@ -144,6 +145,7 @@ 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'),
path('corpus/<uuid:corpus>/selection/', CorpusDeleteSelection.as_view(), name='corpus-delete-selection'),
# Moderation
path('ml-classes/', MLClassList.as_view(), name='mlclass-list'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment