Fix wish cache attempting to generate multiple times

This commit is contained in:
grandeljay 2022-06-21 08:51:27 +02:00
parent 829eb47f2e
commit 3710dbcf52

View file

@ -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');