summaryrefslogtreecommitdiff
path: root/dashboard_website/dashboard.py
diff options
context:
space:
mode:
Diffstat (limited to 'dashboard_website/dashboard.py')
-rw-r--r--dashboard_website/dashboard.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/dashboard_website/dashboard.py b/dashboard_website/dashboard.py
index ed2dffa..ba29799 100644
--- a/dashboard_website/dashboard.py
+++ b/dashboard_website/dashboard.py
@@ -180,6 +180,22 @@ def visitGeneric():
return jsonify({'status' : f"ERROR {result}"})
return jsonify({'status' : "OK"})
+@app.route("/enableClue", methods=['POST'])
+# Expected JSON
+# {"clue_name" : xxxx, str}
+# Returns JSON
+# {"status" : "OK"/"ERROR XX" }
+# ERROR CODES: 1 = missing fields, 2 = clue doesn't exist, 3 = already marked as visited
+def enableClueToggle():
+ content = request.get_json()
+ if not ('clue_name' in content):
+ return jsonify({'status' : "ERROR 1"})
+
+ result = db.toggleEnableClue(content['clue_name'])
+ if result != 0:
+ return jsonify({'status' : f"ERROR {result}"})
+ return jsonify({'status' : "OK"})
+
#
# WEB / DASHBOARD API
#
@@ -223,7 +239,7 @@ def addClueWeb():
if not ('clue_name' in content and 'longitude' in content and 'latitude' in content and 'clue_info' in content):
return jsonify({'status' : "ERROR 1"})
-
+ #db.addClue()
return jsonify({'status' : "OK",})