diff --git a/src/Domain/Scraping/Infrastructure/ApiPlatform/State/Processor/SetMangaPreferredSourcesStateProcessor.php b/src/Domain/Scraping/Infrastructure/ApiPlatform/State/Processor/SetMangaPreferredSourcesStateProcessor.php index c0a64f2..e584e3a 100644 --- a/src/Domain/Scraping/Infrastructure/ApiPlatform/State/Processor/SetMangaPreferredSourcesStateProcessor.php +++ b/src/Domain/Scraping/Infrastructure/ApiPlatform/State/Processor/SetMangaPreferredSourcesStateProcessor.php @@ -5,13 +5,13 @@ namespace App\Domain\Scraping\Infrastructure\ApiPlatform\State\Processor; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProcessorInterface; use App\Domain\Scraping\Application\Command\SetMangaPreferredSources; +use App\Domain\Scraping\Application\CommandHandler\SetMangaPreferredSourcesHandler; use App\Domain\Scraping\Infrastructure\ApiPlatform\Resource\SetMangaPreferredSourcesResource; -use Symfony\Component\Messenger\MessageBusInterface; final class SetMangaPreferredSourcesStateProcessor implements ProcessorInterface { public function __construct( - private readonly MessageBusInterface $commandBus + private readonly SetMangaPreferredSourcesHandler $handler ) { } @@ -26,7 +26,7 @@ final class SetMangaPreferredSourcesStateProcessor implements ProcessorInterface throw new \InvalidArgumentException('Manga ID is required'); } - $this->commandBus->dispatch( + $this->handler->handle( new SetMangaPreferredSources( (string) $mangaId, $data->sourceIds diff --git a/src/Domain/Scraping/Infrastructure/CommandHandler/SymfonySetMangaPreferredSourcesHandler.php b/src/Domain/Scraping/Infrastructure/CommandHandler/SymfonySetMangaPreferredSourcesHandler.php deleted file mode 100644 index c8d93a3..0000000 --- a/src/Domain/Scraping/Infrastructure/CommandHandler/SymfonySetMangaPreferredSourcesHandler.php +++ /dev/null @@ -1,21 +0,0 @@ -handler->handle($command); - } -}