Unable to multiple delete due to AJAX url _id_

Unable to multiple delete due to AJAX url _id_

Muhammad IzzatMuhammad Izzat Posts: 22Questions: 10Answers: 0

Greeting everyone, I am unable to delete multiple row due to my url id turns out to be like this

DELETE http://127.0.0.1:8000/dashboard/content_detail/1,5,7/?id=7 404 (Not Found)

Below is my delete ajax call

ajax: {
            remove: {
                type: 'DELETE',
                url: '/dashboard/content_detail/_id_/',
                data: function (content_data) {
                    var deleted_data = {};
                    $.each(content_data.data, function (id, value) {
                        deleted_data['id'] = id;

                    });
                    return deleted_data;
                },
                success: function () {
                    content_table.api().ajax.reload();
                }
            }
        },

How can I get the id and put in an array so i can create a for loop to execute the url 1 by 1

Any help is much appreciated

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.