Fix wish view

This commit is contained in:
Jay Trees 2022-03-04 09:25:20 +01:00
parent 4b8ee4f1f8
commit 6baffd4f7c

View file

@ -8,6 +8,10 @@
use wishthis\{Page, Wish};
$userIsAuthenticated = false;
$wish = new Wish($_GET['id'], false);
$wishlists = $user->getWishlists($wish->wishlist);
$page = new page(__FILE__, $wish->title);
if ('POST' === $_SERVER['REQUEST_METHOD'] && count($_POST) >= 0) {
@ -21,10 +25,6 @@ if ('POST' === $_SERVER['REQUEST_METHOD'] && count($_POST) >= 0) {
$page->messages[] = Page::success('Wish successfully updated.', 'Success');
}
$userIsAuthenticated = false;
$wish = new Wish($_GET['id'], false);
$wishlists = $user->getWishlists($wish->wishlist);
foreach ($wishlists as $wishlist) {
if ($wish->wishlist === intval($wishlist['id'])) {
$userIsAuthenticated = true;