From ea01560fdf7e29080b08d3126a53f0d4b10d7ec8 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Wed, 23 Apr 2025 11:52:08 +0100 Subject: [PATCH] Bug 38010: (QA follow-up) Convert delete modal to use the API client Signed-off-by: Michaela Sieber Signed-off-by: Jonathan Druart --- koha-tmpl/intranet-tmpl/prog/js/acq.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/acq.js b/koha-tmpl/intranet-tmpl/prog/js/acq.js index 627bdb1381e..dcfe1f728d5 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/acq.js +++ b/koha-tmpl/intranet-tmpl/prog/js/acq.js @@ -439,13 +439,12 @@ $(document).ready(function () { $("#deleteVendorForm").on("submit", function (e) { e.preventDefault(); var id = $("#booksellerid").val(); - let options = { - url: "/api/v1/acquisitions/vendors/" + id, - method: "DELETE", - contentType: "application/json", - }; - $.ajax(options).then(function (thing, result) { - window.location.href = "/cgi-bin/koha/acquisition/vendors"; - }); + const client = APIClient.acquisition; + client.vendors.delete(id).then( + success => { + window.location.href = "/cgi-bin/koha/acquisition/vendors"; + }, + error => {} + ); }); }); -- 2.34.1