Skip to content

Commit

Permalink
fix: UpdateNodeTypeSchemaMessage should be handled synced to avoid Do…
Browse files Browse the repository at this point in the history
…ctrine exception on refresh
  • Loading branch information
ambroisemaupate committed Jun 20, 2023
1 parent 66ad9e1 commit 84a611b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

namespace RZ\Roadiz\CoreBundle\Message;

final class UpdateNodeTypeSchemaMessage implements AsyncMessage
/*
* UpdateNodeTypeSchemaMessage must be handled synchronous
*/
final class UpdateNodeTypeSchemaMessage
{
private int $nodeTypeId;

Expand Down
16 changes: 4 additions & 12 deletions lib/Rozier/src/Controllers/NodeTypes/NodeTypesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,7 @@ public function __construct(MessageBusInterface $messageBus)
$this->messageBus = $messageBus;
}

/**
* List every node-types.
*
* @param Request $request
*
* @return Response
*/
public function indexAction(Request $request)
public function indexAction(Request $request): Response
{
$this->denyAccessUnlessGranted('ROLE_ACCESS_NODETYPES');
/*
Expand Down Expand Up @@ -72,7 +65,7 @@ public function indexAction(Request $request)
*
* @return Response
*/
public function editAction(Request $request, int $nodeTypeId)
public function editAction(Request $request, int $nodeTypeId): Response
{
$this->denyAccessUnlessGranted('ROLE_ACCESS_NODETYPES');

Expand Down Expand Up @@ -116,10 +109,9 @@ public function editAction(Request $request, int $nodeTypeId)
*
* @return Response
*/
public function addAction(Request $request)
public function addAction(Request $request): Response
{
$this->denyAccessUnlessGranted('ROLE_ACCESS_NODETYPES');

$nodeType = new NodeType();

$form = $this->createForm(NodeTypeType::class, $nodeType);
Expand Down Expand Up @@ -155,7 +147,7 @@ public function addAction(Request $request)
*
* @return Response
*/
public function deleteAction(Request $request, int $nodeTypeId)
public function deleteAction(Request $request, int $nodeTypeId): Response
{
$this->denyAccessUnlessGranted('ROLE_ACCESS_NODETYPES_DELETE');

Expand Down

0 comments on commit 84a611b

Please sign in to comment.