This commit is contained in:
paoloar77
2024-05-20 23:43:17 +02:00
parent 58e7c61a76
commit 43e28a148a

View File

@@ -26,7 +26,10 @@
const action = event.target.dataset.action; const action = event.target.dataset.action;
const id = form.querySelector('input[name="id"]').value; const id = form.querySelector('input[name="id"]').value;
fetch(`${window.location}/handle-article-action-pao/${id}/${action}`) let baseUrl = window.location.href;
baseUrl = baseUrl.slice(0, baseUrl.lastIndexOf('/'));
fetch(`${baseUrl}/handle-article-action-pao/${id}/${action}`)
.then(response => response.text()) .then(response => response.text())
.then(data => result.innerHTML = data); .then(data => result.innerHTML = data);
} }