Always use document.body.dataset.apiurl instead of the intermediate const apiUrl

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2025-03-31 21:38:28 +02:00
parent d7a516e964
commit b524a2f4b6
26 changed files with 115 additions and 105 deletions

View File

@@ -5,7 +5,7 @@
* This file is copyright under the latest version of the EUPL.
* Please see LICENSE file for your rights under this license. */
/* global utils:false, apiUrl:false, apiFailure:false, updateFtlInfo:false, processGroupResult:false, delGroupItems:false */
/* global utils:false, apiFailure:false, updateFtlInfo:false, processGroupResult:false, delGroupItems:false */
var table;
@@ -26,7 +26,7 @@ $(function () {
table = $("#groupsTable").DataTable({
processing: true,
ajax: {
url: apiUrl + "/groups",
url: document.body.dataset.apiurl + "/groups",
error: handleAjaxError,
dataSrc: "groups",
type: "GET",
@@ -261,7 +261,7 @@ function addGroup() {
}
$.ajax({
url: apiUrl + "/groups",
url: document.body.dataset.apiurl + "/groups",
method: "post",
dataType: "json",
processData: false,
@@ -329,7 +329,7 @@ function editGroup() {
utils.disableAll();
utils.showAlert("info", "", "Editing group...", oldName);
$.ajax({
url: apiUrl + "/groups/" + oldName,
url: document.body.dataset.apiurl + "/groups/" + oldName,
method: "put",
dataType: "json",
processData: false,