api layer v0.2.2 - CSV import/export, refactor
Some checks failed
Code checks / check-url-paths (push) Has been cancelled
docker / docker_dev (push) Has been cancelled
Deploy MkDocs / deploy (push) Has been cancelled

This commit is contained in:
jokob-sk
2025-08-19 07:56:54 +10:00
parent 9c71a8ecab
commit 962bbaa5a1
14 changed files with 738 additions and 284 deletions

View File

@@ -14,7 +14,8 @@ INSTALL_PATH="/app"
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
from database import get_temp_db_connection
from helper import row_to_json, get_date_from_period, is_random_mac, format_date, get_setting_value
from helper import is_random_mac, format_date, get_setting_value
from db.db_helper import row_to_json
# --------------------------
@@ -68,16 +69,4 @@ def delete_events():
return jsonify({"success": True, "message": "Deleted all events"})
def delete_device_events(mac):
"""Delete all events"""
conn = get_temp_db_connection()
cur = conn.cursor()
sql = "DELETE FROM Events WHERE eve_MAC= ? "
cur.execute(sql, (mac,))
conn.commit()
conn.close()
return jsonify({"success": True, "message": "Deleted all events for the device"})