Use uniqid for wishes and users

This commit is contained in:
Jannis Portmann 2022-01-17 21:25:31 +01:00
parent ee063cd439
commit 946b30b486
10 changed files with 77 additions and 9 deletions

View file

@ -19,7 +19,7 @@ use Symfony\Component\Routing\Annotation\Route;
class TradeController extends AbstractController
{
#[Route('/trade/{id}', name: 'trade')]
#[Route('/trade/{urlId}', name: 'trade')]
public function sendEmail(MailerInterface $mailer, Offering $offer, OfferingRepository $offeringRepository, WishRepository $wishRepository): Response
{
$user = $this->getUser();
@ -35,7 +35,7 @@ class TradeController extends AbstractController
->htmlTemplate('user/trade/offer_email.html.twig')
->context([
'user' => $user,
'id' => $user->getId(),
'urlId' => $user->getUrlId(),
])
;
try
@ -49,6 +49,6 @@ class TradeController extends AbstractController
$this->addFlash('error','You can\'t trade with yourself!');
}
return $this->redirectToRoute('show_offer', ['urlId' => $offer->getId()]);
return $this->redirectToRoute('show_offer', ['urlId' => $offer->getUrlId()]);
}
}