I'm working on a small project using Django and VueJS, i would like todo a bulk delete, i'm sending an array object of my IDs, using Axios in the body like that : [1,2,3]
this is my code :
getAPI({
method: 'DELETE',
url: 'api/contact/delete/',
data:{
ids: this.selected
}
}).then((response) => {
console.log(response.data)
})
how can i loop over my ids in django this is my function :
@action(methods=['delete'], detail=False)
def delete(self, request):
for i in request.body:
print(request[i])