Feat: Add teamer info popup
This commit is contained in:
@@ -4,17 +4,27 @@ namespace App\Controller\Admin\Teamer;
|
||||
|
||||
use App\Entity\Teamer;
|
||||
use App\Model\AjaxModalResponseDto;
|
||||
use App\Repository\DispositionRepository;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class InfoController extends AbstractController
|
||||
{
|
||||
public function __construct(private readonly DispositionRepository $dispositionRepository)
|
||||
{}
|
||||
|
||||
#[Route('/admin/teamer/info/{uuid}', name: 'app_admin_teamer_info')]
|
||||
public function index(Teamer $teamer): JsonResponse
|
||||
{
|
||||
$response = new AjaxModalResponseDto();
|
||||
$recentDispositions = $this->dispositionRepository->getRecentByTeamer($teamer);
|
||||
|
||||
$response = new AjaxModalResponseDto();
|
||||
$response->setContent($this->renderView('admin/teamer/info.html.twig', [
|
||||
'teamer' => $teamer,
|
||||
'recentDispositions' => $recentDispositions,
|
||||
]));
|
||||
|
||||
return $this->json($response);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user