Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main.py deleted unnecessary comments on the search page backend. Please Accept the pull request #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ def add_book():

@app.route('/search', methods=['GET'])
def search():
query = request.args.get('query') # Correctly handle GET requests
query = request.args.get('query')

conn = get_db_connection()
if not conn:
print("Database connection failed") # Or use flash if configured
print("Database connection failed")
return "Error connecting to the database."

cursor = conn.cursor()
Expand Down Expand Up @@ -282,4 +282,4 @@ def lend_book():


if __name__ == "__main__":
app.run(debug=True)
app.run(debug=True)