Skip to content

Commit

Permalink
Update get_search_name.py
Browse files Browse the repository at this point in the history
  • Loading branch information
heukirne authored Dec 4, 2024
1 parent d124419 commit 8ac6698
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/routes/get_search_name.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from sqlalchemy import text
from flask_api import status
from resources.connections import engine
from resources.connections import engine, NAME_QUERY
from resources.cache import cache
from resources.api_decorator import api_endpoint

Expand All @@ -12,12 +12,12 @@ def search_name(partial_name):
results = []
with engine.connect() as connection:
# Prepare the query with the partial name
query = DB_NAME_QUERY.format(partial_name)
query = NAME_QUERY.format(partial_name)
result = connection.execute(text(query))

# Collect results
for row in result:
data = {key: value for key, value in row._mapping.items()}
data = {"idPatient": row[0], "name": row[1]}
results.append(data)

if results:
Expand Down

0 comments on commit 8ac6698

Please sign in to comment.