feat: persist and sort by viewed by admins status of teamers

This commit is contained in:
Björn Fromme committed 2024-06-23 17:28:15 +02:00
1 parent 8d8d6dacd3
commit b58bd9f34f
5 files changed
+72 -7

No files matched your search

@@ -4,6 +4,7 @@ namespace App\Controller\Administrative\Teamer;
use App\Controller\Traits\ReturnUrlTrait;
use App\Entity\Teamer;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@@ -14,10 +15,19 @@ class ProfileController extends AbstractController
{
use ReturnUrlTrait;
public function __construct(private readonly EntityManagerInterface $entityManager)
{
}
#[Route('/administrative/teamer/profile/{uuid}', name: 'app_administrative_teamer_profile')]
#[IsGranted('ROLE_ADMINISTRATIVE')]
public function index(Teamer $teamer, Request $request): Response
{
if (false === $teamer->isViewed()) {
$teamer->setViewed(true);
$this->entityManager->flush();
}
$returnUrl = $this->getReturnUrl($request, 'app_administrative_teamer_index');
return $this->render('administrative/teamer/profile.html.twig', [