mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-10-31 09:18:24 +00:00 
			
		
		
		
	fix requirements on POST route
This commit is contained in:
		| @@ -192,7 +192,7 @@ class CRUDRoutesLoader extends Loader | ||||
|             if ('_entity' === $name && \in_array(Request::METHOD_POST, $methods)) { | ||||
|                 unset($methods[\array_search(Request::METHOD_POST, $methods)]); | ||||
|                 $entityPostRoute = $this->createEntityPostRoute($name, $crudConfig, $action,  | ||||
|                     $controller, $requirements); | ||||
|                     $controller); | ||||
|                 $collection->add("chill_api_single_{$crudConfig['name']}_{$name}_create",  | ||||
|                     $entityPostRoute); | ||||
|             } | ||||
| @@ -212,13 +212,14 @@ class CRUDRoutesLoader extends Loader | ||||
|         return $collection; | ||||
|     } | ||||
|  | ||||
|     private function createEntityPostRoute(string $name, $crudConfig, array $action, $controller, $requirements): Route | ||||
|     private function createEntityPostRoute(string $name, $crudConfig, array $action, $controller): Route | ||||
|     { | ||||
|         $localPath = $action['path'].'.{_format}'; | ||||
|         $defaults = [ | ||||
|             '_controller' => $controller.':'.($action['controller_action'] ?? 'entityPost') | ||||
|         ]; | ||||
|         $path = $crudConfig['base_path'].$localPath; | ||||
|         $requirements = $action['requirements'] ?? []; | ||||
|         $route = new Route($path, $defaults, $requirements); | ||||
|         $route->setMethods([ Request::METHOD_POST ]); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user