feat: ajout d'une route GetMangaByIdHandler.php et fix de la SearchBar.vue
This commit is contained in:
parent
ed0a075a6c
commit
d9e935f7de
@@ -15,6 +15,7 @@ readonly class MangaResponse
|
||||
public string $status,
|
||||
public ?string $externalId,
|
||||
public ?string $imageUrl,
|
||||
public ?string $thumbnailUrl,
|
||||
public ?float $rating
|
||||
) {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Domain\Manga\Application\Response;
|
||||
readonly class MangaSearchItem
|
||||
{
|
||||
public function __construct(
|
||||
public int $id,
|
||||
public string $externalId,
|
||||
public string $title,
|
||||
public string $slug,
|
||||
@@ -14,6 +15,7 @@ readonly class MangaSearchItem
|
||||
public array $genres,
|
||||
public string $status,
|
||||
public ?string $imageUrl,
|
||||
public ?string $thumbnailUrl,
|
||||
public ?float $rating
|
||||
) {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Manga\Application\Response;
|
||||
|
||||
readonly class SearchLocalMangaResponse
|
||||
{
|
||||
/**
|
||||
* @param MangaSearchItem[] $items
|
||||
*/
|
||||
public function __construct(
|
||||
public array $items,
|
||||
public int $total,
|
||||
public int $page,
|
||||
public int $limit
|
||||
) {}
|
||||
|
||||
public function hasNextPage(): bool
|
||||
{
|
||||
return $this->total > ($this->page * $this->limit);
|
||||
}
|
||||
|
||||
public function hasPreviousPage(): bool
|
||||
{
|
||||
return $this->page > 1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user