Skip to content

Commit

Permalink
fix: change request search back to being a search
Browse files Browse the repository at this point in the history
  • Loading branch information
EPortman committed Dec 11, 2024
1 parent 9b3bec3 commit 0953943
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/namex/VERSION.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.2.15'
__version__ = '1.2.16'
7 changes: 4 additions & 3 deletions api/namex/resources/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,13 @@ def get():
example: query=NR3742302 or query=abcd
"""
data = []
nr_num = request.args.get('query', '').strip().upper()
nr_num = '%' + request.args.get('query', '').strip().upper() + '%'
rows = request.args.get('rows', 10, type=int)

try:
# Find the NR only if it is not cancelled & not expired or if it has expired within a 60 day grace period.
query = RequestDAO.query.filter(
RequestDAO.nrNum == nr_num,
RequestDAO.nrNum.like(nr_num),
RequestDAO.stateCd != State.CANCELLED,
or_(
RequestDAO.stateCd != State.EXPIRED,
Expand All @@ -404,7 +405,7 @@ def get():
lazyload('*'),
eagerload(RequestDAO.names).load_only(Name.name),
load_only(RequestDAO.id, RequestDAO.nrNum)
)
).limit(rows)
result = query.all()
data = [{
'nrNum': nr.nrNum,
Expand Down

0 comments on commit 0953943

Please sign in to comment.