Here is my code for application.py pset8 search route which always returns 0 or empty array, I can't figure out why, Kindly help
@app.route("/search", methods=["GET", "POST"])
def search():
"""Search for places that match query."""
""" If method used is not Get raise error"""
if request.method != "GET":
raise RuntimeError ("Use get request method")
else:
q = request.args.get("q") + "%"
place = db.execute("SELECT * FROM places WHERE postal_code LIKE :q", q=q)
return jsonify(place)
This code's raw data returns
[]
I have changed the code, But my first problem is the empty array returned from the data base. The empty code array is taken from Raw Data.