Skip to content

Commit

Permalink
adding more query options
Browse files Browse the repository at this point in the history
  • Loading branch information
sureshhewabi committed Feb 9, 2024
1 parent 537668e commit bfdd033
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/routes/pride.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ async def project_search(q: Union[str | None] = Query(default="",
projects = None
where_condition = ""

if q and q != '*':
if q and q != '*' and q != 'all':
where_condition += """ WHERE p.project_id LIKE '%' || :query || '%' OR
p.title LIKE '%' || :query || '%' OR
p.description LIKE '%' || :query || '%' OR
Expand Down Expand Up @@ -631,7 +631,7 @@ async def protein_search(project_id: Annotated[str, Path(...,
try:
where_condition = """project_detail_id IN (SELECT id FROM projectdetails WHERE project_id = :project_id)"""

if q and q != '*':
if q and q != '*' and q != 'all':
where_condition += """ AND (protein_accession LIKE '%' || :query || '%'
OR gene_name LIKE '%' || :query || '%'
OR protein_name LIKE '%' || :query || '%')
Expand Down

0 comments on commit bfdd033

Please sign in to comment.