Fix wishlists not loading
This commit is contained in:
parent
fbc94d045e
commit
b8cd1ea3cc
3 changed files with 2 additions and 7 deletions
|
@ -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(
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -16,8 +16,6 @@ if (isset($_POST['name'])) {
|
|||
(' . $_SESSION['user']['id'] . ', "' . $_POST['name'] . '")
|
||||
;');
|
||||
|
||||
$_SESSION['user'] = $user;
|
||||
|
||||
header('Location: ?page=home');
|
||||
die();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue