mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-01 12:33:49 +00:00
Signature: get the stored object back in the check signature API
This commit is contained in:
@@ -23,6 +23,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Messenger\MessageBusInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||
|
||||
class SignatureRequestController
|
||||
{
|
||||
@@ -31,6 +32,7 @@ class SignatureRequestController
|
||||
private readonly StoredObjectManagerInterface $storedObjectManager,
|
||||
private readonly EntityWorkflowManager $entityWorkflowManager,
|
||||
private readonly ChillEntityRenderManagerInterface $entityRender,
|
||||
private readonly NormalizerInterface $normalizer,
|
||||
private readonly Security $security,
|
||||
) {}
|
||||
|
||||
@@ -72,6 +74,14 @@ class SignatureRequestController
|
||||
#[Route('/api/1.0/document/workflow/{id}/check-signature', name: 'chill_docstore_check_signature')]
|
||||
public function checkSignature(EntityWorkflowStepSignature $signature): JsonResponse
|
||||
{
|
||||
return new JsonResponse($signature->getState(), JsonResponse::HTTP_OK, []);
|
||||
$entityWorkflow = $signature->getStep()->getEntityWorkflow();
|
||||
$storedObject = $this->entityWorkflowManager->getAssociatedStoredObject($entityWorkflow);
|
||||
|
||||
return new JsonResponse(
|
||||
[
|
||||
'state' => $signature->getState(),
|
||||
'storedObject' => $this->normalizer->normalize($storedObject, 'json')
|
||||
],
|
||||
JsonResponse::HTTP_OK, []);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user