Fixed empty list bug
Some checks are pending
linter / quality (push) Waiting to run
tests / ci (push) Waiting to run

This commit is contained in:
Edward Tirado Jr 2025-12-16 00:19:12 -06:00
parent e3b6d302c6
commit ff6c59329b
2 changed files with 3 additions and 1 deletions

View file

@ -26,8 +26,10 @@ class SearchPanel extends Component
public function findMovies(MovieDbInterface $movie_db): void public function findMovies(MovieDbInterface $movie_db): void
{ {
try { try {
logger()->info("finding movies");
//$movie = $movie_db->search($this->query, ["type" => "imdb"]); //$movie = $movie_db->search($this->query, ["type" => "imdb"]);
$this->results = $movie_db->search($this->query, ["type" => "title"]); $this->results = $movie_db->search($this->query, ["type" => "title"]);
logger()->info($this->results);
} catch (NotFoundHttpException $e) { } catch (NotFoundHttpException $e) {
$this->addError('query', 'Movie not found'); $this->addError('query', 'Movie not found');
} }

View file

@ -28,7 +28,7 @@
Add Movie Add Movie
</button> </button>
</div> </div>
@if(!empty($filteredMovies)) @if(!$filteredMovies->isEmpty())
<ul class="grid grid-cols-2 sm:grid-cols-4 gap-5"> <ul class="grid grid-cols-2 sm:grid-cols-4 gap-5">
@foreach ($filteredMovies as $movie) @foreach ($filteredMovies as $movie)
<li class="bg-gray-200"> <li class="bg-gray-200">