From 9c75f877935fa6adec951a4d8d32b328aaab314f Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 13 Jun 2020 13:08:01 +0200 Subject: Use multi-level routes for existing controllers instead of 1 level everywhere Also prefix most admin routes with /admin/ --- assets/default/js/base.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'assets/default/js') diff --git a/assets/default/js/base.js b/assets/default/js/base.js index b428a420..9f67d980 100644 --- a/assets/default/js/base.js +++ b/assets/default/js/base.js @@ -463,7 +463,7 @@ function init(description) { }); if (window.confirm(message)) { - window.location = `${basePath}/?delete_link&lf_linkdate=${ids.join('+')}&token=${token.value}`; + window.location = `${basePath}/admin/shaare/delete?id=${ids.join('+')}&token=${token.value}`; } }); } @@ -549,7 +549,7 @@ function init(description) { const refreshedToken = document.getElementById('token').value; const fromtag = block.getAttribute('data-tag'); const xhr = new XMLHttpRequest(); - xhr.open('POST', `${basePath}/manage-tags`); + xhr.open('POST', `${basePath}/admin/tags`); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.onload = () => { if (xhr.status !== 200) { @@ -566,7 +566,7 @@ function init(description) { .setAttribute('href', `${basePath}/?searchtags=${encodeURIComponent(totag)}`); block .querySelector('a.rename-tag') - .setAttribute('href', `${basePath}/manage-tags?fromtag=${encodeURIComponent(totag)}`); + .setAttribute('href', `${basePath}/admin/tags?fromtag=${encodeURIComponent(totag)}`); // Refresh awesomplete values existingTags = existingTags.map(tag => (tag === fromtag ? totag : tag)); @@ -600,7 +600,7 @@ function init(description) { if (confirm(`Are you sure you want to delete the tag "${tag}"?`)) { const xhr = new XMLHttpRequest(); - xhr.open('POST', `${basePath}/manage-tags`); + xhr.open('POST', `${basePath}/admin/tags`); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.onload = () => { block.remove(); -- cgit v1.2.3