|
|
@@ -6,10 +6,12 @@ namespace App\State\Processor\Organization;
|
|
|
|
|
|
use ApiPlatform\Metadata\Delete;
|
|
|
use ApiPlatform\Metadata\Operation;
|
|
|
+use ApiPlatform\Metadata\Post;
|
|
|
use ApiPlatform\State\ProcessorInterface;
|
|
|
use App\ApiResources\Organization\OrganizationCreationRequest;
|
|
|
use App\ApiResources\Organization\OrganizationDeletionRequest;
|
|
|
use App\Message\Command\OrganizationCreationCommand;
|
|
|
+use App\Message\Command\OrganizationDeletionCommand;
|
|
|
use App\Service\Organization\OrganizationFactory;
|
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
|
use Symfony\Component\Messenger\MessageBusInterface;
|
|
|
@@ -22,15 +24,20 @@ class OrganizationDeletionRequestProcessor implements ProcessorInterface
|
|
|
) {}
|
|
|
|
|
|
/**
|
|
|
- * @param OrganizationDeletionRequest $organizationDeletionRequest
|
|
|
+ * @param OrganizationDeletionRequest $data
|
|
|
* @param mixed[] $uriVariables
|
|
|
* @param mixed[] $context
|
|
|
*
|
|
|
* @throws \Exception
|
|
|
*/
|
|
|
- public function process(mixed $organizationDeletionRequest, Operation $operation, array $uriVariables = [], array $context = []): OrganizationCreationRequest
|
|
|
+ public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): OrganizationDeletionRequest
|
|
|
{
|
|
|
- if (!$operation instanceof Delete) {
|
|
|
+ /**
|
|
|
+ * @var OrganizationDeletionRequest $organizationDeletionRequest
|
|
|
+ */
|
|
|
+ $organizationDeletionRequest = $data;
|
|
|
+
|
|
|
+ if (!$operation instanceof Post) {
|
|
|
throw new \RuntimeException('not supported', Response::HTTP_METHOD_NOT_ALLOWED);
|
|
|
}
|
|
|
|