Fix:
- modal backdrop, pas de backdrop, pas de problème...
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Twig\Components;
|
||||
|
||||
use App\Repository\MangaRepository;
|
||||
use App\Service\MangadexProvider;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
@@ -20,7 +21,7 @@ class MangaSearch
|
||||
#[LiveProp(writable: true)]
|
||||
public ?string $query = null;
|
||||
|
||||
public function __construct(private readonly MangadexProvider $mangadexProvider)
|
||||
public function __construct(private readonly MangadexProvider $mangadexProvider, private MangaRepository $mangaRepository)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -29,10 +30,12 @@ class MangaSearch
|
||||
*/
|
||||
public function getMangas(): Collection|null
|
||||
{
|
||||
if ($this->query === null || $this->query === '') {
|
||||
return null;
|
||||
}
|
||||
return new ArrayCollection($this->mangaRepository->findAll());
|
||||
|
||||
return $this->mangadexProvider->search($this->query);
|
||||
// if ($this->query === null || $this->query === '') {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// return $this->mangadexProvider->search($this->query);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user