move route handling to offerController

This commit is contained in:
Jannis Portmann 2021-05-19 13:38:37 +02:00
parent e4c3aa17af
commit 90d67833e1
2 changed files with 11 additions and 11 deletions

View file

@ -139,4 +139,15 @@ class OfferController extends AbstractController
throw new HttpException(403, "No permission"); throw new HttpException(403, "No permission");
} }
#[Route('/myoffers', name: 'own_offers')]
public function ownOffers(OfferingRepository $offeringRepository): Response
{
$user = $this->getUser();
return $this->render('user/offers.html.twig', [
'user' => $user,
'offers' => $offeringRepository->findByUser($user),
]);
}
} }

View file

@ -105,15 +105,4 @@ class UserController extends AbstractController
throw new HttpException(403, "No permission"); throw new HttpException(403, "No permission");
} }
#[Route('/myoffers', name: 'own_offers')]
public function ownOffers(OfferingRepository $offeringRepository): Response
{
$user = $this->getUser();
return $this->render('user/offers.html.twig', [
'user' => $user,
'offers' => $offeringRepository->findByUser($user),
]);
}
} }