diff options
| author | Anson Bridges <bridges.anson@gmail.com> | 2024-07-02 16:47:39 +0200 |
|---|---|---|
| committer | Anson Bridges <bridges.anson@gmail.com> | 2024-07-02 16:47:39 +0200 |
| commit | 9690fc0e4a319941f3103b1c43d8509c22c20a4f (patch) | |
| tree | 38918f34d453a42f203f5522eb6737d05894ea16 /dashboard_website/dashboard.py | |
| parent | 80cfb271b27bceb9e357d77d34449cd368d72240 (diff) | |
slight improvements
Diffstat (limited to 'dashboard_website/dashboard.py')
| -rw-r--r-- | dashboard_website/dashboard.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/dashboard_website/dashboard.py b/dashboard_website/dashboard.py index b9b8bbc..90bd718 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",}) |
