Skip to content

Commit 2099e5d

Browse files
authored
Update routes.py
1 parent 8d28db3 commit 2099e5d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ def index():
1313

1414
if name:
1515
cursor.execute(
16-
"SELECT * FROM books WHERE name LIKE :name", {'name': f"%{name}%"}
16+
"SELECT * FROM books WHERE name LIKE '%" + name + "%'"
1717
)
1818
books = [Book(*row) for row in cursor]
1919

2020
elif author:
2121
cursor.execute(
22-
"SELECT * FROM books WHERE author LIKE :author", {'author': f"%{author}%"}
22+
"SELECT * FROM books WHERE author LIKE '%" + author + "%'"
2323
)
2424
books = [Book(*row) for row in cursor]
2525

0 commit comments

Comments
 (0)