From 131664ae9a6e266bdbcd3b5114b3d708211e901b Mon Sep 17 00:00:00 2001 From: Gokul Prathin Date: Fri, 23 Aug 2024 23:02:23 -0400 Subject: [PATCH] :children_crossing: changes to use fetch instead of jQuery --- src/main/resources/static/js/gw.history.js | 25 +++++++++++----------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/main/resources/static/js/gw.history.js b/src/main/resources/static/js/gw.history.js index de849002..799410a7 100644 --- a/src/main/resources/static/js/gw.history.js +++ b/src/main/resources/static/js/gw.history.js @@ -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. @@ -313,15 +313,14 @@ GW.history = { "" + 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;