diff --git a/src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php b/src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php index d48973350..9d61d6233 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php +++ b/src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php @@ -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 ]);