This commit is contained in:
Jay Trees 2022-02-23 11:20:55 +01:00
parent 8fbe7682e7
commit 3a239019e3
4 changed files with 9 additions and 7 deletions

View file

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

View file

@ -10,7 +10,6 @@ $(function() {
on: 'now',
onSuccess: function(response, element, xhr) {
wishlists = response.results;
console.log(wishlists);
element.dropdown({
values: wishlists,

View file

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

View file

@ -62,7 +62,7 @@ class Wishlist
ob_start();
/**
* Exclude
* Options
*/
$exclude = isset($options['exclude']) ? $options['exclude'] : array();