Parcourir la source

set category and type to always be string

ksieren il y a 2 ans
Parent
commit
9c93461bab
1 fichiers modifiés avec 5 ajouts et 9 suppressions
  1. 5 9
      Classes/Controller/DashboardController.php

+ 5 - 9
Classes/Controller/DashboardController.php

@@ -64,16 +64,12 @@ class DashboardController extends ActionController
         $this->view->assign('terms', $terms);
     }
 
-    public function createAction(string $termList, $categoryTitle, $typeTitle, string $urlTitle): void {
+    public function createAction(string $termList, string $categoryTitle, string $typeTitle, string $urlTitle): void {
         $terms = array_map('trim', explode(';', $termList));
-        if($categoryTitle){
-            $category = $this->categoryController->createAction($categoryTitle);
-            $categoryObj = $this->categoryRepository->findByUid($category);
-        }
-        if($typeTitle){
-            $type = $this->typeController->createAction($typeTitle);
-            $typeObj = $this->typeRepository->findByUid($type);
-        }
+        $category = $this->categoryController->createAction($categoryTitle);
+        $categoryObj = $this->categoryRepository->findByUid($category);
+        $type = $this->typeController->createAction($typeTitle);
+        $typeObj = $this->typeRepository->findByUid($type);
         $url = $this->urlController->createAction($urlTitle);
         $urlObj = $this->urlRepository->findByUid($url);
         $this->termController->createAction($terms, $categoryObj, $typeObj, $urlObj);