mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-11-02 10:13:35 -05:00
refator: reuse search page component (#2240)
* wip: fix recipe card section * refactor basic search to share composable * fix dialog results * use search for cat/tag/tool pages * update organizer to support name edits * fix composable typing
This commit is contained in:
@@ -342,6 +342,8 @@ class RepositoryGeneric(Generic[Schema, Model]):
|
||||
|
||||
count_query = select(func.count()).select_from(query)
|
||||
count = self.session.scalar(count_query)
|
||||
if not count:
|
||||
count = 0
|
||||
|
||||
# interpret -1 as "get_all"
|
||||
if pagination.per_page == -1:
|
||||
@@ -349,7 +351,6 @@ class RepositoryGeneric(Generic[Schema, Model]):
|
||||
|
||||
try:
|
||||
total_pages = ceil(count / pagination.per_page)
|
||||
|
||||
except ZeroDivisionError:
|
||||
total_pages = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user