Skip to content

Commit

Permalink
Update routes.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cfsgranda authored Jul 10, 2024
1 parent 03b2586 commit d14380b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ def index():

if name:
cursor.execute(
"SELECT * FROM books WHERE name LIKE '%" + name + "%'"
"SELECT * FROM books WHERE name LIKE %s", name
)
books = [Book(*row) for row in cursor]

elif author:
cursor.execute(
"SELECT * FROM books WHERE author LIKE '%" + author + "%'"
"SELECT * FROM books WHERE author LIKE %s", author
)
books = [Book(*row) for row in cursor]

Expand Down

0 comments on commit d14380b

Please sign in to comment.