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']) {
|
switch ($_SERVER['REQUEST_METHOD']) {
|
||||||
case 'GET':
|
case 'GET':
|
||||||
if (isset($_GET['userid'])) {
|
if (isset($_GET['userid']) || isset($_SESSION['user']['id'])) {
|
||||||
$user = new User($_GET['userid']);
|
$user = isset($_GET['userid']) ? new User($_GET['userid']) : new User();
|
||||||
$wishlists = $user->getWishlists();
|
$wishlists = $user->getWishlists();
|
||||||
$wishlists = array_map(function ($wishlist) {
|
$wishlists = array_map(function ($wishlist) {
|
||||||
return array(
|
return array(
|
||||||
|
|
|
@ -10,9 +10,6 @@ $(function() {
|
||||||
$('.ui.dropdown.wishlists').api({
|
$('.ui.dropdown.wishlists').api({
|
||||||
action: 'get wishlists',
|
action: 'get wishlists',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
data : {
|
|
||||||
userid: 1
|
|
||||||
},
|
|
||||||
on: 'now',
|
on: 'now',
|
||||||
onResponse: function(response) {
|
onResponse: function(response) {
|
||||||
console.log('onResponse');
|
console.log('onResponse');
|
||||||
|
|
|
@ -16,8 +16,6 @@ if (isset($_POST['name'])) {
|
||||||
(' . $_SESSION['user']['id'] . ', "' . $_POST['name'] . '")
|
(' . $_SESSION['user']['id'] . ', "' . $_POST['name'] . '")
|
||||||
;');
|
;');
|
||||||
|
|
||||||
$_SESSION['user'] = $user;
|
|
||||||
|
|
||||||
header('Location: ?page=home');
|
header('Location: ?page=home');
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue