From f649855c2c8b269098a4ea396378144bb0493d6a Mon Sep 17 00:00:00 2001 From: grandeljay Date: Tue, 21 Jun 2022 09:20:54 +0200 Subject: [PATCH] Fix wish not updating information --- src/assets/js/wishlists.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/assets/js/wishlists.js b/src/assets/js/wishlists.js index d8de94fd..9f310174 100644 --- a/src/assets/js/wishlists.js +++ b/src/assets/js/wishlists.js @@ -142,6 +142,7 @@ $(function () { var wishlistIndex = $('.ui.dropdown.wishlists select').prop('selectedIndex') - 1; var wishlist_user = wishlists[wishlistIndex].user; + card.addClass('loading'); card.attr('data-cache', 'false'); fetch('/src/api/wishes.php?wish_id=' + card.attr('data-id') + '&wishlist_user=' + wishlist_user, { @@ -149,6 +150,9 @@ $(function () { }) .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');