diff --git a/src/api/wishlists.php b/src/api/wishlists.php index 3c3a85a5..d22a959f 100644 --- a/src/api/wishlists.php +++ b/src/api/wishlists.php @@ -19,6 +19,7 @@ switch ($_SERVER['REQUEST_METHOD']) { case 'GET': if (isset($_GET['userid']) || isset($_SESSION['user']['id'])) { $user = isset($_GET['userid']) ? new User($_GET['userid']) : new User(); + $wishlists = $user->getWishlists(); $wishlists = array_map(function ($dataWishlist) { $data = $dataWishlist; @@ -31,6 +32,7 @@ switch ($_SERVER['REQUEST_METHOD']) { return $data; }, $wishlists); + $response['results'] = $wishlists; $response['success'] = true; } diff --git a/src/assets/js/wishlist-view.js b/src/assets/js/wishlist-view.js index 2cc9fc44..895655fc 100644 --- a/src/assets/js/wishlist-view.js +++ b/src/assets/js/wishlist-view.js @@ -10,7 +10,6 @@ $(function() { on: 'now', onSuccess: function(response, element, xhr) { wishlists = response.results; - console.log(wishlists); element.dropdown({ values: wishlists, diff --git a/src/classes/embed-cache.php b/src/classes/embed-cache.php index 9b86e217..12536bec 100644 --- a/src/classes/embed-cache.php +++ b/src/classes/embed-cache.php @@ -52,9 +52,10 @@ class EmbedCache $info_simplified->providerUrl = ''; $info_simplified->publishedTime = ''; $info_simplified->redirect = ''; - $info_simplified->title = ''; - $info_simplified->url = ''; + $info_simplified->title = $url; + $info_simplified->url = $url; + /* try { $info = $embed->get($url); @@ -78,13 +79,13 @@ class EmbedCache $info_simplified->title = (string) $info->title; $info_simplified->url = (string) $info->url; } catch (\Throwable $ex) { - $info_simplified->title = (string) $ex->getMessage(); - $info_simplified->url = (string) $url; + $info_simplified->title = $ex->getMessage(); } + */ $info = $info_simplified; - file_put_contents($filepath, json_encode($info)); + // file_put_contents($filepath, json_encode($info)); } return $info; diff --git a/src/classes/wishlist.php b/src/classes/wishlist.php index 3b0b41a3..8774ea6e 100644 --- a/src/classes/wishlist.php +++ b/src/classes/wishlist.php @@ -62,7 +62,7 @@ class Wishlist ob_start(); /** - * Exclude + * Options */ $exclude = isset($options['exclude']) ? $options['exclude'] : array();