generate url first

This commit is contained in:
Jannis Portmann 2021-05-29 19:45:45 +02:00
parent 67f756436e
commit 0dab627482

View file

@ -16,12 +16,16 @@ use Symfony\Component\Mime\Email;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
class TradeController extends AbstractController
{
#[Route('/trade/{id}', name: 'trade')]
public function sendEmail(MailerInterface $mailer, Offering $offer, OfferingRepository $offeringRepository, WishRepository $wishRepository): Response
{
$user = $this->getUser();
$mail_url = $this->generateUrl('user_public', [
'id' => $offer->getByUser()->getId(),
], UrlGeneratorInterface::ABSOLUTE_URL);
if($user != $offer->getByUser())
{
@ -35,9 +39,7 @@ class TradeController extends AbstractController
->context([
'user' => $user,
'id' => $offer->getByUser()->getId(),
'userOffersLink' => $this->generateUrl('user_public', [
'id' => $offer->getByUser()->getId(),
], UrlGeneratorInterface::ABSOLUTE_URL)
'userOffersLink' => $mail_url,
])
;
try