Skip to content

Commit 098ff63

Browse files
committed
Bump version and add hideflagged query param
Update package version to 2.1.7 and extend the get_prospects endpoint with a new boolean Query parameter `hideflagged` (default false). When true, the query adds `flag IS NOT TRUE` to the WHERE clause to exclude flagged records; existing search, pagination, and limits remain unchanged. This enables clients to optionally filter out flagged prospects.
1 parent e184bce commit 098ff63

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

app/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""Python - FastAPI, Postgres, tsvector"""
22

33
# Current Version
4-
__version__ = "2.1.6"
4+
__version__ = "2.1.7"

app/api/prospects/prospects.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
def get_prospects(
1414
page: int = Query(1, ge=1, description="Page number (1-based)"),
1515
limit: int = Query(100, ge=1, le=500, description="Records per page (default 100, max 500)"),
16-
search: str = Query(None, description="Search term for first or last name (case-insensitive, partial match)")
16+
search: str = Query(None, description="Search term for first or last name (case-insensitive, partial match)"),
17+
hideflagged: bool = Query(False, description="If true, flagged records are excluded")
1718
) -> dict:
1819
"""Return paginated, filtered, and ordered prospects (then alphabetical by first_name), filtered by search if provided."""
1920
meta = make_meta("success", "Read paginated prospects")
@@ -25,6 +26,8 @@ def get_prospects(
2526
# Build WHERE clause
2627
where_clauses = ["hide IS NOT TRUE"]
2728
params = []
29+
if hideflagged:
30+
where_clauses.append("flag IS NOT TRUE")
2831
if search:
2932
where_clauses.append("(LOWER(first_name) LIKE %s OR LOWER(last_name) LIKE %s)")
3033
search_param = f"%{search.lower()}%"

0 commit comments

Comments
 (0)