Skip to content

Commit 2bdf25c

Browse files
committed
FE: refactor API call in restartBackend function to use dynamic URL and token
1 parent 63222f4 commit 2bdf25c

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

front/js/common.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,12 +1586,16 @@ function restartBackend() {
15861586

15871587
modalEventStatusId = 'modal-message-front-event'
15881588

1589+
const apiToken = getSetting("API_TOKEN");
1590+
const apiBaseUrl = getApiBase();
1591+
const url = `${apiBaseUrl}/logs/add-to-execution-queue`;
1592+
15891593
// Execute
15901594
$.ajax({
15911595
method: "POST",
1592-
url: "/logs/add-to-execution-queue",
1596+
url: url,
15931597
headers: {
1594-
"Authorization": "Bearer " + getSetting("API_TOKEN"),
1598+
"Authorization": "Bearer " + apiToken,
15951599
"Content-Type": "application/json"
15961600
},
15971601
data: JSON.stringify({ action: `${getGuid()}|cron_restart_backend` }),

0 commit comments

Comments
 (0)