From 947be36ef3709e67d2ab61eb14b47228b11da44c Mon Sep 17 00:00:00 2001 From: Zahdi <ZahdiMohcine20@gmail.com> Date: Tue, 25 Mar 2025 21:56:28 +0100 Subject: [PATCH] [Progress] minor changes --- config/packages/security.yaml | 2 +- docker/docker-compose.yml | 1 - src/Controller/WishlistController.php | 8 ++++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/config/packages/security.yaml b/config/packages/security.yaml index ab531b70..730a51d5 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -26,7 +26,7 @@ security: access_control: - { path: ^/admin, allow_if: "user and user.isAdmin == true" } - - { path: ^/locked, allow_if: "user and user.isLocked == true" } + - { path: ^/*, allow_if: "user and user.isLocked != true" } when@test: security: diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 0e63ddee..fef96537 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -10,7 +10,6 @@ services: ports: - 3306:3306 environment: - MYSQL_ROOT_USER: 'root' MYSQL_ROOT_PASSWORD: 'root' networks: - dev diff --git a/src/Controller/WishlistController.php b/src/Controller/WishlistController.php index 1a39ebad..24a225ff 100644 --- a/src/Controller/WishlistController.php +++ b/src/Controller/WishlistController.php @@ -15,7 +15,7 @@ use Symfony\Component\Routing\Attribute\Route; final class WishlistController extends AbstractController { #[Route(name: 'app_wishlist_index', methods: ['GET'])] - public function index(WishlistRepository $wishlistRepository): Response + public function getWishLists(WishlistRepository $wishlistRepository): Response { return $this->render('wishlist/index.html.twig', [ 'wishlists' => $wishlistRepository->findAll(), @@ -23,11 +23,11 @@ final class WishlistController extends AbstractController } #[Route('/new', name: 'app_wishlist_new', methods: ['GET', 'POST'])] - public function new(Request $request, EntityManagerInterface $entityManager): Response + public function createWishlist(Request $request, EntityManagerInterface $entityManager): Response { $wishlist = new Wishlist(); - $name = $request->get('name'); - $wishlist->setName($name); + $name = $request->get(key: 'name'); + $wishlist->setName(name: $name); $deadline = $request->get('deadline') ; $wishlist->setDeadline($deadline); $entityManager->persist($wishlist); -- GitLab