mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-12 02:43:12 -05:00
feat: Generalize Search to Other Models (#2472)
* generalized search logic to SearchFilter * added default search behavior for all models * fix for schema overrides * added search support to several models * fix for label search * tests and fixes * add config for normalizing characters * dramatically simplified search tests * bark bark * fix normalization bug * tweaked tests * maybe this time? --------- Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
This commit is contained in:
@@ -41,10 +41,11 @@ class MultiPurposeLabelsController(BaseUserController):
|
||||
return HttpRepo(self.repo, self.logger, self.registered_exceptions, self.t("generic.server-error"))
|
||||
|
||||
@router.get("", response_model=MultiPurposeLabelPagination)
|
||||
def get_all(self, q: PaginationQuery = Depends(PaginationQuery)):
|
||||
def get_all(self, q: PaginationQuery = Depends(PaginationQuery), search: str | None = None):
|
||||
response = self.repo.page_all(
|
||||
pagination=q,
|
||||
override=MultiPurposeLabelSummary,
|
||||
search=search,
|
||||
)
|
||||
|
||||
response.set_pagination_guides(router.url_path_for("get_all"), q.dict())
|
||||
|
||||
Reference in New Issue
Block a user