Optimized implementation of create

This commit is contained in:
Kevin Frantz
2019-02-25 20:45:15 +01:00
parent 6d146c8478
commit 90b14a1ef5
6 changed files with 35 additions and 14 deletions

View File

@@ -16,9 +16,7 @@ use Infinito\DBAL\Types\ActionType;
* @see https://symfony.com/blog/new-in-symfony-4-1-prefix-imported-route-names
* @see https://symfony.com/blog/new-in-symfony-4-1-internationalized-routing
* @Route(
* {
* "en":"/api/rest/{layer}/{identity}.{_format}",
* },
* "/api/rest/{layer}",
* defaults={
* "identity"="",
* "_format"="json"
@@ -29,6 +27,25 @@ final class LayerController extends AbstractAPIController
{
/**
* @Route(
* ".{_format}",
* methods={"GET","POST"}
* )
* {@inheritdoc}
*
* @see \Infinito\Controller\API\AbstractAPIController::read()
*/
public function create(MVCRoutineServiceInterface $mvcRoutineService, RequestedActionServiceInterface $requestedActionService, string $layer, $identity): Response
{
$requestedActionService->setActionType(ActionType::CREATE);
$requestedActionService->setLayer($layer);
$view = $mvcRoutineService->process();
return $this->handleView($view);
}
/**
* @Route(
* "/{identity}.{_format}",
* methods={"GET"}
* )
* {@inheritdoc}