feat: Renommage de GetManga à GetMangaById + ajout de axios
This commit is contained in:
parent
666636e5bf
commit
504c62c155
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Domain\Manga\Application\Query;
|
||||
|
||||
readonly class GetManga
|
||||
readonly class GetMangaById
|
||||
{
|
||||
public function __construct(
|
||||
public string $id
|
||||
) {}
|
||||
}
|
||||
}
|
||||
@@ -2,18 +2,18 @@
|
||||
|
||||
namespace App\Domain\Manga\Application\QueryHandler;
|
||||
|
||||
use App\Domain\Manga\Application\Query\GetManga;
|
||||
use App\Domain\Manga\Application\Query\GetMangaById;
|
||||
use App\Domain\Manga\Application\Response\MangaResponse;
|
||||
use App\Domain\Manga\Domain\Contract\Repository\MangaRepositoryInterface;
|
||||
use App\Domain\Manga\Domain\Exception\MangaNotFoundException;
|
||||
|
||||
readonly class GetMangaHandler
|
||||
readonly class GetMangaByIdHandler
|
||||
{
|
||||
public function __construct(
|
||||
private MangaRepositoryInterface $mangaRepository
|
||||
) {}
|
||||
|
||||
public function handle(GetManga $query): MangaResponse
|
||||
public function handle(GetMangaById $query): MangaResponse
|
||||
{
|
||||
$manga = $this->mangaRepository->findById($query->id);
|
||||
|
||||
@@ -35,4 +35,4 @@ readonly class GetMangaHandler
|
||||
rating: $manga->getRating()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user