From d550d014643fd45c4c1e5b8093f3e8251491cd09 Mon Sep 17 00:00:00 2001 From: thisfro Date: Sun, 6 Jun 2021 11:20:51 +0200 Subject: [PATCH] Refactoring --- src/Controller/TradeController.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/Controller/TradeController.php b/src/Controller/TradeController.php index effc2cc..3cd4868 100644 --- a/src/Controller/TradeController.php +++ b/src/Controller/TradeController.php @@ -14,20 +14,14 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Mailer\MailerInterface; use Symfony\Component\Mime\Email; use Symfony\Component\Routing\Annotation\Route; -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -use Symfony\Component\Routing\RouterInterface; class TradeController extends AbstractController { #[Route('/trade/{id}', name: 'trade')] - public function sendEmail(MailerInterface $mailer, Offering $offer, OfferingRepository $offeringRepository, WishRepository $wishRepository, RouterInterface $router): Response + public function sendEmail(MailerInterface $mailer, Offering $offer, OfferingRepository $offeringRepository, WishRepository $wishRepository): Response { $user = $this->getUser(); - $this->router = $router; - $mail_url = $this->router->generate('user_public', [ - 'id' => $offer->getByUser()->getId(), - ], UrlGeneratorInterface::ABSOLUTE_URL); if($user != $offer->getByUser()) { @@ -40,8 +34,7 @@ class TradeController extends AbstractController ->htmlTemplate('user/trade/offer_email.html.twig') ->context([ 'user' => $user, - 'id' => $offer->getByUser()->getId(), - 'userOffersLink' => $mail_url, + 'id' => $user->getId(), ]) ; try