diff --git a/.htaccess b/.htaccess index bed7f119..4bbb01b3 100644 --- a/.htaccess +++ b/.htaccess @@ -8,7 +8,7 @@ RewriteRule ^([a-z\-]+)/(\d+)$ /?page=$1&id=$2 [QSA,L] # Wishlists - RewriteRule ^([a-z\-]+)/(\d+)$ /?page=$1&wishlist=$2 [QSA,L] + RewriteRule ^([a-z\-]+)/(\d+)$ /?page=$1&id=$2 [QSA,L] # Wishlist RewriteRule ^wishlist/([a-z0-9]+)$ /?wishlist=$1 [QSA,L] diff --git a/src/assets/js/wishlists.js b/src/assets/js/wishlists.js index 6edf5341..5ac7e952 100644 --- a/src/assets/js/wishlists.js +++ b/src/assets/js/wishlists.js @@ -17,8 +17,8 @@ $(function () { placeholder : text.wishlist_no_selection }) - if ($_GET.wishlist) { - element.dropdown('set selected', $_GET.wishlist); + if ($_GET.id) { + element.dropdown('set selected', $_GET.id); } else { if (wishlists[0]) { element.dropdown('set selected', wishlists[0].value); @@ -53,9 +53,11 @@ $(function () { $('.wishlist-delete').removeClass('disabled'); /** Update URL */ - urlParams.set('wishlist', wishlistValue); + urlParams.set('id', wishlistValue); - fetch('/src/api/url.php?url=' + btoa(urlParams.toString()), { + console.log(wishlistValue); + + fetch('/src/api/url.php?url=' + window.btoa(urlParams.toString()), { method: 'GET' }) .then(handleFetchError) diff --git a/src/pages/wish.php b/src/pages/wish.php index d124bec4..2460885f 100644 --- a/src/pages/wish.php +++ b/src/pages/wish.php @@ -56,7 +56,7 @@ $page->header(); $page->bodyStart(); $page->navigation(); -$referer = '/?page=wishlists&wishlist=' . $wish->wishlist; +$referer = '/?page=wishlists&id=' . $wish->wishlist; ?>