Browse Source

Merge branch 'develop'

* develop:
  set category and type to always be string
ksieren 2 năm trước cách đây
mục cha
commit
9a7eee2514
1 tập tin đã thay đổi với 5 bổ sung9 xóa
  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);