I am having trouble with PUT/DELETE URL in ajax calls
I am having trouble with PUT/DELETE URL in ajax calls
ChuckT
Posts: 8Questions: 4Answers: 1
I am having an issue with the URL that is being rendered when I make a call to delete or update a table row. DataTables is adding a query string to the end.
i.e.
apiProtectedPath + "vehicle/undefined?action=remove&data%5B18816011-f2af-4570-b7e…el%5D=&data%5B18816011-f2af-4570-b7ec-b8d0fcce1948%5D%5Bis_available%5D=:1
What I need to have is
apiProtectedPath + "vehicle/" + vehicleIdToUse,
with nothing in between.
I am using the current version of DataTables and Editor with a Postgres backend.
Below is the snippet of my delete portion of the Editor.
remove: {
type: 'DELETE',
dataSrc: "data.vehicles",
processData: false,
url: apiPathProtected + "vehicle/" + vehicleIdToUse,
beforeSend: function (request) {
request.setRequestHeader("X-Access-Token", user.token);
request.setRequestHeader("Content-Type", "application/json");
}
}
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I have solved this issue, Thanks
Thanks for posting back. Great to hear you have it resolved now.
Regards,
Allan
So here is the code that solved my problem. Using id in the URL string did exactly what I needed.