#[Route(path: '/api/_action/order/{orderId}/state/{transition}', name: 'api.action.order.state_machine.order.transition_state', methods: ['POST'])]
public function orderStateTransition( string
$orderId,
string
$transition,
Request
$request,
Context
$context ): JsonResponse
{ $documentTypes =
$request->request->
all('documentTypes'
);
if (\
count($documentTypes) > 0
) { $skipSentDocuments =
(bool) $request->request->
get('skipSentDocuments', false
);
$documentIds =
$this->
getDocumentIds('order',
$orderId,
$documentTypes,
$skipSentDocuments);
} else { $documentIds =
$request->request->
all('documentIds'
);
} $mediaIds =
$request->request->
all('mediaIds'
);
$context->
addExtension( MailSendSubscriberConfig::MAIL_CONFIG_EXTENSION,
new MailSendSubscriberConfig( $request->request->
get('sendMail', true
) === false,
$documentIds,