diff --git a/src/api/wishlists.php b/src/api/wishlists.php index 2fcf5b34..08c52949 100644 --- a/src/api/wishlists.php +++ b/src/api/wishlists.php @@ -142,7 +142,12 @@ switch ($_SERVER['REQUEST_METHOD']) { $wishlist = Wishlist::getFromHash($_GET['wishlist_hash']); if ($wishlist instanceof Wishlist) { - $response['results'] = $wishlist; + $response['results'] = array( + 'id' => $wishlist->getId(), + 'hash' => $wishlist->getHash(), + 'userId' => $wishlist->getUserId(), + ); + ; } else { http_response_code(404); } diff --git a/src/assets/js/parts/wish.js b/src/assets/js/parts/wish.js index 4648f77b..2effb3ea 100644 --- a/src/assets/js/parts/wish.js +++ b/src/assets/js/parts/wish.js @@ -55,6 +55,8 @@ $(function () { 'onShow' : function() { var user_is_current = wishlist && wishlist.userId === parseInt($('[name="user-id"]').val()); + console.log('user_is_current', user_is_current); + if (user_is_current) { $('.ui.button.wish-fulfil').remove(); } else { diff --git a/src/assets/js/wishlist.js b/src/assets/js/wishlist.js index db97d7b7..c9b9ddb9 100644 --- a/src/assets/js/wishlist.js +++ b/src/assets/js/wishlist.js @@ -41,6 +41,7 @@ $(function() { .then(handleFetchResponse) .then(function(response) { wishlist = response.results; + console.log(wishlist); }); }