Skip to content

Commit

Permalink
Typesense
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioMendolia committed Jan 26, 2024
1 parent 91f9df1 commit 81fdb02
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/symfony.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ jobs:
DATABASE_URL: sqlite:///%kernel.project_dir%/data/database.sqlite
run: |
bin/console doctrine:schema:create --env=test
bin/console doctrine:schema:update --force --env=test
bin/console doctrine:schema:update --force --complete --env=test
composer test
Binary file added data/database.sqlite
Binary file not shown.
2 changes: 1 addition & 1 deletion src/Twig/Components/AddBookToShelf.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function remove(EntityManagerInterface $entityManager, #[LiveArg] int $sh
$shelf = $shelfRepository->find($shelfId);

if (null === $shelf) {
throw new RuntimeException('Shelf not found');
throw new \RuntimeException('Shelf not found');
}

$this->book->removeShelf($shelf);
Expand Down
18 changes: 18 additions & 0 deletions templates/components/Search.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<div {{ attributes }}>
<input
type="text"
data-model="query"
placeholder="{{ 'search'|trans }}"
class="form-control w-100 rounded-0 border-0"
>

{% if computed.books|length > 0 %}
<ul data-loading="addClass(opacity-50)" class="position-absolute bg-dark-subtle text-light w-100 vh-100 overflow-scroll p-2">
{% for book in computed.books %}
<li class="p-1">
{{ include('book/_search.html.twig') }}
</li>
{% endfor %}
</ul>
{% endif %}
</div>

0 comments on commit 81fdb02

Please sign in to comment.