svg
This commit is contained in:
@ -6,6 +6,7 @@ use App\Entity\Project;
|
||||
use App\Entity\User;
|
||||
use App\Form\ProjectType;
|
||||
use App\Repository\ProjectRepository;
|
||||
use App\Service\FileService;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@ -15,6 +16,13 @@ use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
class ProjectController extends AbstractController
|
||||
{
|
||||
private FileService $fileService;
|
||||
|
||||
public function __construct(FileService $fileService)
|
||||
{
|
||||
$this->fileService = $fileService;
|
||||
}
|
||||
|
||||
#[Route('/admin/project', name: 'app_admin_project')]
|
||||
public function list(ProjectRepository $projectRepository): Response
|
||||
{
|
||||
@ -41,6 +49,7 @@ class ProjectController extends AbstractController
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$em->persist($project);
|
||||
$em->flush();
|
||||
$this->fileService->init('project', $project->getId());
|
||||
|
||||
return $this->redirectToRoute('app_admin_project');
|
||||
}
|
||||
|
Reference in New Issue
Block a user