From 4a4771f8ebafdda3b903dd5554a1cb5cb83d063c Mon Sep 17 00:00:00 2001 From: Manuel Aranda Date: Mon, 4 Aug 2025 12:37:23 +0200 Subject: [PATCH] refs #2591. new response. Added job_id --- src/State/Processor/ImageProcessor.php | 5 +++-- src/State/Processor/PartitionProcessor.php | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/State/Processor/ImageProcessor.php b/src/State/Processor/ImageProcessor.php index a042009..9d21ec2 100644 --- a/src/State/Processor/ImageProcessor.php +++ b/src/State/Processor/ImageProcessor.php @@ -89,8 +89,9 @@ readonly class ImageProcessor implements ProcessorInterface } if ($response instanceof JsonResponse && $response->getStatusCode() === 200) { - $jobContent = json_decode($response->getContent(), true); - return new JsonResponse(data: $jobContent, status: Response::HTTP_OK); + $jobContent = json_decode($response->getContent(), true, 512, JSON_UNESCAPED_SLASHES); + $jsonString = json_encode($jobContent, JSON_UNESCAPED_SLASHES); + return new JsonResponse($jsonString, Response::HTTP_OK, [], true); } return new JsonResponse(data: ['/clients/' . $image->getClient()->getUuid() => ['headers' => []]], status: Response::HTTP_OK); diff --git a/src/State/Processor/PartitionProcessor.php b/src/State/Processor/PartitionProcessor.php index 583061e..56803c0 100644 --- a/src/State/Processor/PartitionProcessor.php +++ b/src/State/Processor/PartitionProcessor.php @@ -76,13 +76,13 @@ readonly class PartitionProcessor implements ProcessorInterface $response = $this->partitionAssistantAction->__invoke($data); - // Si hay una respuesta exitosa, devolvemos el contenido del job ID if ($response instanceof JsonResponse && $response->getStatusCode() === 200) { - $jobContent = json_decode($response->getContent(), true); - return new JsonResponse(data: $jobContent, status: Response::HTTP_OK); + $jobContent = json_decode($response->getContent(), true, 512, JSON_UNESCAPED_SLASHES); + $jsonString = json_encode($jobContent, JSON_UNESCAPED_SLASHES); + return new JsonResponse($jsonString, Response::HTTP_OK, [], true); } - return new JsonResponse('OK', Response::HTTP_NO_CONTENT); + return new JsonResponse(data: ['/clients/' . $image->getClient()->getUuid() => ['headers' => []]], status: Response::HTTP_OK); } private function processDelete($data, Operation $operation, array $uriVariables = [], array $context = []): null