diff --git a/src/Controller/Dashboard/CategoryController.php b/src/Controller/Dashboard/CategoryController.php index f42d811..7ec3df4 100644 --- a/src/Controller/Dashboard/CategoryController.php +++ b/src/Controller/Dashboard/CategoryController.php @@ -44,15 +44,6 @@ class CategoryController extends AbstractController ): Response { $this->appLogger->record('VIEW', 'Consultation de la page de catégorie'); - foreach (['2-7 Ans','3-15 Ans','3-99 Ans','Barnums','Alimentaire','Options'] as $catName) { - $cat = $categoryRepository->findOneBy(['name'=>$catName]); - if(!$cat instanceof Category) { - $cat = new Category(); - $cat->setName($catName); - $this->em->persist($cat); - } - $this->em->flush(); - } return $this->render('dashboard/category/list.twig', [ 'categorys' => $categoryRepository->findAll(), diff --git a/templates/dashboard/category/list.twig b/templates/dashboard/category/list.twig index 91f9951..09e7615 100644 --- a/templates/dashboard/category/list.twig +++ b/templates/dashboard/category/list.twig @@ -41,6 +41,7 @@ {# ACTIONS #}
+ {% if category.name != "2-7 Ans" %} @@ -50,6 +51,7 @@ class="p-2 bg-rose-500/10 hover:bg-rose-600 text-rose-500 hover:text-white rounded-xl transition-all border border-rose-500/20"> + {% endif %}