add: json
This commit is contained in:
@@ -77,8 +77,10 @@ def delete():
|
|||||||
|
|
||||||
@app.route("/lookup", methods=["POST"])
|
@app.route("/lookup", methods=["POST"])
|
||||||
def lookup():
|
def lookup():
|
||||||
name = request.form.get("name")
|
data = request.get_json()
|
||||||
|
if not data or "name" not in data:
|
||||||
|
return jsonify({"error": "Not found"}), 404
|
||||||
|
name = data["name"]
|
||||||
conn = get_db_connection()
|
conn = get_db_connection()
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
|
|||||||
Reference in New Issue
Block a user