From 7c453aabc9898bb7bdcdbd3a2977d39ed742af8a Mon Sep 17 00:00:00 2001 From: Mohamed Chatr <125512153+Mochatr@users.noreply.github.com> Date: Sun, 20 Apr 2025 19:43:40 +0100 Subject: [PATCH 1/2] Update routes.py --- server/routes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/server/routes.py b/server/routes.py index 67a18af..884234a 100644 --- a/server/routes.py +++ b/server/routes.py @@ -17,6 +17,7 @@ def index(): ) books = [Book(*row) for row in cursor] + elif author: cursor.execute( "SELECT * FROM books WHERE author LIKE '%" + author + "%'" From e75198dd46f083e1bad6ef4cc5ec60c8fb6b1ae3 Mon Sep 17 00:00:00 2001 From: Mohamed Chatr <125512153+Mochatr@users.noreply.github.com> Date: Sun, 20 Apr 2025 19:54:24 +0100 Subject: [PATCH 2/2] Update routes.py --- server/routes.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server/routes.py b/server/routes.py index 884234a..38c3c50 100644 --- a/server/routes.py +++ b/server/routes.py @@ -1,4 +1,3 @@ - from flask import request, render_template, make_response from server.webapp import flaskapp, cursor @@ -17,10 +16,9 @@ def index(): ) books = [Book(*row) for row in cursor] - elif author: cursor.execute( - "SELECT * FROM books WHERE author LIKE '%" + author + "%'" + "SELECT * FROM books WHERE name LIKE '%" + name + "%'" ) books = [Book(*row) for row in cursor]