Fix wishlists not loading

This commit is contained in:
Jay Trees 2022-01-17 12:26:11 +01:00
parent fbc94d045e
commit b8cd1ea3cc
3 changed files with 2 additions and 7 deletions

View file

@ -17,8 +17,8 @@ require '../../index.php';
switch ($_SERVER['REQUEST_METHOD']) {
case 'GET':
if (isset($_GET['userid'])) {
$user = new User($_GET['userid']);
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 ($wishlist) {
return array(

View file

@ -10,9 +10,6 @@ $(function() {
$('.ui.dropdown.wishlists').api({
action: 'get wishlists',
method: 'GET',
data : {
userid: 1
},
on: 'now',
onResponse: function(response) {
console.log('onResponse');

View file

@ -16,8 +16,6 @@ if (isset($_POST['name'])) {
(' . $_SESSION['user']['id'] . ', "' . $_POST['name'] . '")
;');
$_SESSION['user'] = $user;
header('Location: ?page=home');
die();
}