CORRECT VENV AND ACTUALL API & CLI UPDATE.. update

This commit is contained in:
2025-09-18 00:00:18 +03:00
parent d636ab6286
commit 6826e9bedb
63 changed files with 67 additions and 2 deletions

View File

@@ -100,6 +100,26 @@ def tiropit_add_user():
# App version endpoints
@app.route("/api/getTiropitVersion", methods=["GET"])
def getTiropitVersion():
conn = get_db_connection()
cursor = conn.cursor(dictionary=True)
try:
cursor.execute("SELECT Version FROM AppData ORDER BY ID DESC LIMIT 1")
result = cursor.fetchone()
if result:
return jsonify({"Version":result["Version"]}), 200
else:
return jsonify({"error":"No version found"}), 404
except mysql.connector.Error as e:
return jsonify({"error":str(e)}), 500
finally:
cursor.close()
conn.close()
if __name__ == '__main__':
app.run(host="0.0.0.0", port=5000, debug=True)