Show wishes on offer page

This commit is contained in:
Jannis Portmann 2021-05-04 12:33:58 +02:00
parent 4e7b8ec340
commit eaebcaad57
4 changed files with 59 additions and 1 deletions

View file

@ -6,6 +6,8 @@ use App\Entity\Offering;
use App\Form\OfferingFormType;
use App\Repository\OfferingRepository;
use App\Repository\WishRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
@ -70,10 +72,11 @@ class OfferController extends AbstractController
}
#[Route('/offer/{id}', name: 'show_offer')]
public function show_offer(Offering $offering): Response
public function show_offer(Offering $offering, WishRepository $wishRepository): Response
{
return $this->render('app/offer.html.twig', [
'offer' => $offering,
'wishes' => $wishRepository->findByUser($offering->getByUser()),
]);
}
}