Skip to content

Commit

Permalink
🚸 changes to use fetch instead of jQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
gokulprathin8 committed Aug 24, 2024
1 parent 031d3ba commit 131664a
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/main/resources/static/js/gw.history.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,14 @@ GW.history = {


removeFailedHistory: function(processId) {
const formData = new FormData();
formData.append('processId', processId);
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({"processId": processId})
method: 'DELETE',
body: formData,
}
fetch("delete-failed", options)
GW.process.sidepanel.history(processId, 'testing_data_integration');
},
/**
* Generates an HTML table with process execution history data.
Expand Down Expand Up @@ -313,15 +313,14 @@ GW.history = {
"</div>" + content ;


$('#failed-history-rm').on('click', function () {
console.log("history removed failed clicked");
const historyProcess = $(this).data("history-remove-failed");
const userConfirmed = confirm("Are you sure you want to remove the failed history?");
$(document).on('click', '#failed-history-rm', function () {
const historyProcess = $(this).data("history-process");
const userConfirmed = confirm("Are you sure you want to remove the failed history?");

if (userConfirmed) {
GW.history.removeFailedHistory(historyProcess);
}
})
if (userConfirmed) {
GW.history.removeFailedHistory(historyProcess);
}
});

return content;

Expand Down

0 comments on commit 131664a

Please sign in to comment.