From 3710dbcf52cc4c21714083cf1527b0d9d9e1bbb3 Mon Sep 17 00:00:00 2001 From: grandeljay Date: Tue, 21 Jun 2022 08:51:27 +0200 Subject: [PATCH] Fix wish cache attempting to generate multiple times --- src/assets/js/wishlists.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/assets/js/wishlists.js b/src/assets/js/wishlists.js index c437f729..d8de94fd 100644 --- a/src/assets/js/wishlists.js +++ b/src/assets/js/wishlists.js @@ -142,14 +142,13 @@ $(function () { var wishlistIndex = $('.ui.dropdown.wishlists select').prop('selectedIndex') - 1; var wishlist_user = wishlists[wishlistIndex].user; + card.attr('data-cache', 'false'); + fetch('/src/api/wishes.php?wish_id=' + card.attr('data-id') + '&wishlist_user=' + wishlist_user, { method: 'GET' }) .then(handleFetchError) .then(handleFetchResponse) - .then(function(response) { - card.replaceWith(response.html.replace('data-cache="true"', 'data-cache="false"')); - }) .catch(handleFetchCatch) .finally(function() { card.removeClass('loading');