Show wishes on offer page
This commit is contained in:
parent
4e7b8ec340
commit
eaebcaad57
4 changed files with 59 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
|||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Wish;
|
||||
use App\Entity\User;
|
||||
use App\Form\WishFormType;
|
||||
|
||||
use App\Repository\WishRepository;
|
||||
|
@ -56,4 +57,14 @@ class UserController extends AbstractController
|
|||
'wish_form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/user/{id}', name: 'public_wishlist')]
|
||||
public function show_user(User $user, WishRepository $wishRepository): Response
|
||||
{
|
||||
return $this->render('user/public_wishlist.html.twig', [
|
||||
'username' => $user->getUsername(),
|
||||
'wishes' => $wishRepository->findByUser($user),
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue