Release 2.45 (#5721)
Co-authored-by: Henning Klein <info@henningklein.de>
This commit is contained in:
@@ -16,6 +16,7 @@ use App\Form\Type\CustomerType;
|
||||
use App\Form\Type\ProjectType;
|
||||
use App\Repository\Query\TeamQuery;
|
||||
use App\Repository\TeamRepository;
|
||||
use App\User\TeamService;
|
||||
use App\Utils\DataTable;
|
||||
use App\Utils\PageSetup;
|
||||
use Symfony\Component\Form\Extension\Core\Type\FormType;
|
||||
@@ -30,7 +31,10 @@ use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
#[IsGranted('view_team')]
|
||||
final class TeamController extends AbstractController
|
||||
{
|
||||
public function __construct(private TeamRepository $repository)
|
||||
public function __construct(
|
||||
private readonly TeamRepository $repository,
|
||||
private readonly TeamService $teamService,
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -85,7 +89,9 @@ final class TeamController extends AbstractController
|
||||
#[IsGranted('create_team')]
|
||||
public function createTeam(Request $request): Response
|
||||
{
|
||||
return $this->renderEditScreen(new Team(''), $request, true);
|
||||
$team = $this->teamService->createNewTeam('');
|
||||
|
||||
return $this->renderEditScreen($team, $request, true);
|
||||
}
|
||||
|
||||
#[Route(path: '/{id}/duplicate', name: 'team_duplicate', methods: ['GET', 'POST'])]
|
||||
@@ -128,7 +134,7 @@ final class TeamController extends AbstractController
|
||||
|
||||
if ($editForm->isSubmitted() && $editForm->isValid()) {
|
||||
try {
|
||||
$this->repository->saveTeam($team);
|
||||
$this->teamService->saveTeam($team);
|
||||
$this->flashSuccess('action.update.success');
|
||||
|
||||
return $this->redirectToRoute('admin_team_edit', ['id' => $team->getId()]);
|
||||
@@ -167,7 +173,7 @@ final class TeamController extends AbstractController
|
||||
|
||||
if ($editForm->isSubmitted() && $editForm->isValid()) {
|
||||
try {
|
||||
$this->repository->saveTeam($team);
|
||||
$this->teamService->saveTeam($team);
|
||||
$this->flashSuccess('action.update.success');
|
||||
|
||||
if ($create) {
|
||||
|
||||
Reference in New Issue
Block a user