fix: wish details

This commit is contained in:
grandeljay 2023-09-07 16:26:17 +02:00
parent cfe30781a9
commit bccd9356cf
3 changed files with 9 additions and 1 deletions

View file

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

View file

@ -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 {

View file

@ -41,6 +41,7 @@ $(function() {
.then(handleFetchResponse)
.then(function(response) {
wishlist = response.results;
console.log(wishlist);
});
}