diff --git a/frontend/static/js/add.js b/frontend/static/js/add.js index 58d9c4b..34847a7 100644 --- a/frontend/static/js/add.js +++ b/frontend/static/js/add.js @@ -52,7 +52,7 @@ function addReminder() { }) .catch(e => { if (e === 401) { - window.location.href = url_prefix; + window.location.href = `${url_prefix}/`; } else if (e === 400) { inputs.time.classList.add('error-input'); inputs.time.title = 'Time is in the past'; @@ -158,7 +158,7 @@ function testReminder() { }) .catch(e => { if (e === 401) { - window.location.href = url_prefix; + window.location.href = `${url_prefix}/`; }; }); }; diff --git a/frontend/static/js/edit.js b/frontend/static/js/edit.js index 42ad2e3..080e007 100644 --- a/frontend/static/js/edit.js +++ b/frontend/static/js/edit.js @@ -51,7 +51,7 @@ function editReminder() { }) .catch(e => { if (e === 401) { - window.location.href = url_prefix; + window.location.href = `${url_prefix}/`; } else { console.log(e); }; @@ -99,7 +99,7 @@ function showEdit(id) { }) .catch(e => { if (e === 401) { - window.location.href = url_prefix; + window.location.href = `${url_prefix}/`; } else if (e === 404) { fillList(); } else { @@ -142,7 +142,7 @@ function deleteReminder() { }) .catch(e => { if (e === 401) { - window.location.href = url_prefix; + window.location.href = `${url_prefix}/`; } else if (e === 404) { fillList(); } else { diff --git a/frontend/static/js/general.js b/frontend/static/js/general.js index 83a7142..bb18ab8 100644 --- a/frontend/static/js/general.js +++ b/frontend/static/js/general.js @@ -4,7 +4,7 @@ function logout() { }) .then(response => { sessionStorage.removeItem('api_key'); - window.location.href = url_prefix || '/'; + window.location.href = `${url_prefix}/`; }); }; @@ -52,7 +52,7 @@ function showTab(tab_id, button_id, load_function=null) { const url_prefix = document.getElementById('url_prefix').dataset.value; const api_key = sessionStorage.getItem('api_key'); if (api_key === null) { - window.location.href = url_prefix; + window.location.href = `${url_prefix}/`; }; document.getElementById('toggle-nav').addEventListener('click', e => toggleNav()); diff --git a/frontend/static/js/notification.js b/frontend/static/js/notification.js index f6b6cc0..c3c8b8c 100644 --- a/frontend/static/js/notification.js +++ b/frontend/static/js/notification.js @@ -87,7 +87,7 @@ function fillNotificationSelection() { }) .catch(e => { if (e === 401) { - window.location.href = url_prefix; + window.location.href = `${url_prefix}/`; } else { console.log(e); }; @@ -113,7 +113,7 @@ function deleteService(id) { }) .catch(e => { if (e.error === 'ApiKeyExpired' || e.error === 'ApiKeyInvalid') { - window.location.href = url_prefix; + window.location.href = `${url_prefix}/`; } else if (e.error === 'NotificationServiceInUse') { const delete_button = row.querySelector('button[title="Delete"]'); delete_button.classList.add('error-icon'); @@ -151,7 +151,7 @@ function saveService(id) { }) .catch(e => { if (e === 401) { - window.location.href = url_prefix; + window.location.href = `${url_prefix}/`; } else if (e === 400) { save_button.classList.add('error-icon'); save_button.title = 'Invalid Apprise URL'; @@ -199,7 +199,7 @@ function addService() { }) .catch(e => { if (e === 401) { - window.location.href = url_prefix; + window.location.href = `${url_prefix}/`; } else if (e === 400) { inputs_buttons.save_button.classList.add('error-icon'); inputs_buttons.save_button.title = 'Invalid Apprise URL'; diff --git a/frontend/static/js/reminders.js b/frontend/static/js/reminders.js index 54af9c7..892f7a8 100644 --- a/frontend/static/js/reminders.js +++ b/frontend/static/js/reminders.js @@ -55,7 +55,7 @@ function fillList() { }) .catch(e => { if (e === 401) { - window.location.href = url_prefix; + window.location.href = `${url_prefix}/`; } else { console.log(e); }; @@ -77,7 +77,7 @@ function search() { }) .catch(e => { if (e === 401) { - window.location.href = url_prefix; + window.location.href = `${url_prefix}/`; } else { console.log(e); }; diff --git a/frontend/static/js/settings.js b/frontend/static/js/settings.js index 9065cc5..80698e9 100644 --- a/frontend/static/js/settings.js +++ b/frontend/static/js/settings.js @@ -16,7 +16,7 @@ function changePassword() { }) .catch(e => { if (e === 401) { - window.location.href = url_prefix; + window.location.href = `${url_prefix}/`; } else { console.log(e); }; @@ -28,7 +28,7 @@ function deleteAccount() { 'method': 'DELETE' }) .then(response => { - window.location.href = url_prefix; + window.location.href = `${url_prefix}/`; }); }; diff --git a/frontend/static/js/templates.js b/frontend/static/js/templates.js index b7ff021..306a593 100644 --- a/frontend/static/js/templates.js +++ b/frontend/static/js/templates.js @@ -57,7 +57,7 @@ function loadTemplates(force=true) { }) .catch(e => { if (e === 401) { - window.location.href = url_prefix; + window.location.href = `${url_prefix}/`; } else { console.log(e); }; @@ -99,7 +99,7 @@ function loadTemplate() { }) .catch(e => { if (e === 401) { - window.location.href = url_prefix; + window.location.href = `${url_prefix}/`; } else { console.log(e); }; @@ -134,7 +134,7 @@ function addTemplate() { }) .catch(e => { if (e === 401) { - window.location.href = url_prefix; + window.location.href = `${url_prefix}/`; } else { console.log(e); }; @@ -177,7 +177,7 @@ function showEditTemplate(id) { }) .catch(e => { if (e === 401) { - window.location.href = url_prefix; + window.location.href = `${url_prefix}/`; } else { console.log(e); }; @@ -210,7 +210,7 @@ function saveTemplate() { }) .catch(e => { if (e === 401) { - window.location.href = url_prefix; + window.location.href = `${url_prefix}/`; } else { console.log(e); }; @@ -233,7 +233,7 @@ function deleteTemplate() { }) .catch(e => { if (e === 401) { - window.location.href = url_prefix; + window.location.href = `${url_prefix}/`; } else { console.log(e); };