Fix wish not updating information
This commit is contained in:
parent
c6a5ac7caa
commit
f649855c2c
1 changed files with 4 additions and 0 deletions
|
@ -142,6 +142,7 @@ $(function () {
|
||||||
var wishlistIndex = $('.ui.dropdown.wishlists select').prop('selectedIndex') - 1;
|
var wishlistIndex = $('.ui.dropdown.wishlists select').prop('selectedIndex') - 1;
|
||||||
var wishlist_user = wishlists[wishlistIndex].user;
|
var wishlist_user = wishlists[wishlistIndex].user;
|
||||||
|
|
||||||
|
card.addClass('loading');
|
||||||
card.attr('data-cache', 'false');
|
card.attr('data-cache', 'false');
|
||||||
|
|
||||||
fetch('/src/api/wishes.php?wish_id=' + card.attr('data-id') + '&wishlist_user=' + wishlist_user, {
|
fetch('/src/api/wishes.php?wish_id=' + card.attr('data-id') + '&wishlist_user=' + wishlist_user, {
|
||||||
|
@ -149,6 +150,9 @@ $(function () {
|
||||||
})
|
})
|
||||||
.then(handleFetchError)
|
.then(handleFetchError)
|
||||||
.then(handleFetchResponse)
|
.then(handleFetchResponse)
|
||||||
|
.then(function(response) {
|
||||||
|
card.replaceWith(response.html.replace('data-cache="true"', 'data-cache="false"'));
|
||||||
|
})
|
||||||
.catch(handleFetchCatch)
|
.catch(handleFetchCatch)
|
||||||
.finally(function() {
|
.finally(function() {
|
||||||
card.removeClass('loading');
|
card.removeClass('loading');
|
||||||
|
|
Loading…
Reference in a new issue