fix: potential race condition
This commit is contained in:
parent
6838e26f32
commit
a5c743d563
1 changed files with 4 additions and 3 deletions
|
@ -33,15 +33,16 @@ $(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get wishlist by hash
|
* Get wishlist by Id
|
||||||
*/
|
*/
|
||||||
if (!wishlist && wishthis.$_GET.hash) {
|
if (!wishlist && wishthis.$_GET.hash) {
|
||||||
fetch('/api/wishlists/' + wishthis.$_GET.hash, { method: 'GET' })
|
var wishlistId = $('.wishlist-cards[data-wishlist]').attr('data-wishlist');
|
||||||
|
|
||||||
|
fetch('/api/wishlists/' + wishlistId, { method: 'GET' })
|
||||||
.then(handleFetchError)
|
.then(handleFetchError)
|
||||||
.then(handleFetchResponse)
|
.then(handleFetchResponse)
|
||||||
.then(function(response) {
|
.then(function(response) {
|
||||||
wishlist = response.results;
|
wishlist = response.results;
|
||||||
console.log(wishlist);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue