change homepage route

This commit is contained in:
Jannis Portmann 2021-05-09 11:20:45 +02:00
parent 19d2bfbcc3
commit d10ef764bc
7 changed files with 80 additions and 64 deletions

View file

@ -25,7 +25,7 @@ class OfferController extends AbstractController
$this->entityManager = $entityManager;
}
#[Route('/', name: 'homepage')]
#[Route('/offers', name: 'offers')]
public function index(Environment $twig, OfferingRepository $offerRepository): Response
{
return new Response($twig->render('app/index.html.twig', [
@ -62,7 +62,7 @@ class OfferController extends AbstractController
$this->entityManager->flush();
$this->addFlash("success", "Successfully added the new offer!");
return $this->redirectToRoute('homepage');
return $this->redirectToRoute('offers');
}
return $this->render('app/new_offer.html.twig', [
@ -75,6 +75,7 @@ class OfferController extends AbstractController
public function show_offer(Offering $offer, WishRepository $wishRepository): Response
{
return $this->render('app/offer.html.twig', [
'user' => $this->getUser(),
'offer' => $offer,
'wishes' => $wishRepository->findByUser($offer->getByUser()),
]);