General refactor
This commit is contained in:
@@ -26,7 +26,7 @@ setEventListeners(upload, async () => {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
|
||||
fetch('/app/upload', {
|
||||
fetch(`${app_url}/upload`, {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
}).then((response) => {
|
||||
@@ -43,11 +43,11 @@ setEventListeners(upload, async () => {
|
||||
});
|
||||
|
||||
setEventListeners(add, () => {
|
||||
window.location.href = "/app/add";
|
||||
window.location.href = `${app_url}/add`;
|
||||
});
|
||||
|
||||
setEventListeners(download, () => {
|
||||
window.location.href = "/app/download";
|
||||
window.location.href = `${app_url}/download`;
|
||||
});
|
||||
|
||||
setEventListeners(logout, () => {
|
||||
@@ -58,6 +58,6 @@ const sql_rows = sql_table.rows;
|
||||
|
||||
for (let i = 1; i < sql_rows.length; i++) {
|
||||
setEventListeners(sql_rows[i], () => {
|
||||
window.location.href = `/app/edit?element=${sql_rows[i].cells[0].innerText}`;
|
||||
window.location.href = `${app_url}/edit?element=${sql_rows[i].cells[0].innerText}`;
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user