diff --git a/app/__init__.py b/app/__init__.py index 5ffc4af..08a9ea4 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1,4 +1,4 @@ """Python - FastAPI, Postgres, tsvector""" # Current Version -__version__ = "2.1.6" +__version__ = "2.1.7" diff --git a/app/api/prospects/prospects.py b/app/api/prospects/prospects.py index 353f83d..080e0af 100644 --- a/app/api/prospects/prospects.py +++ b/app/api/prospects/prospects.py @@ -13,7 +13,8 @@ def get_prospects( page: int = Query(1, ge=1, description="Page number (1-based)"), limit: int = Query(100, ge=1, le=500, description="Records per page (default 100, max 500)"), - search: str = Query(None, description="Search term for first or last name (case-insensitive, partial match)") + search: str = Query(None, description="Search term for first or last name (case-insensitive, partial match)"), + hideflagged: bool = Query(False, description="If true, flagged records are excluded") ) -> dict: """Return paginated, filtered, and ordered prospects (then alphabetical by first_name), filtered by search if provided.""" meta = make_meta("success", "Read paginated prospects") @@ -25,6 +26,8 @@ def get_prospects( # Build WHERE clause where_clauses = ["hide IS NOT TRUE"] params = [] + if hideflagged: + where_clauses.append("flag IS NOT TRUE") if search: where_clauses.append("(LOWER(first_name) LIKE %s OR LOWER(last_name) LIKE %s)") search_param = f"%{search.lower()}%"