feat: add server-side device deletion
- add portal API and UI action to delete non-default devices - protect the configured portal default device from deletion - document that trip/history pages still scope to the single DEVICE_NAME Co-authored-by: Copilot <[email protected]>
This commit is contained in:
@@ -187,6 +187,13 @@ def acknowledge_device_sync(device_id, config_version):
|
||||
)
|
||||
|
||||
|
||||
def delete_device(device_id):
|
||||
with get_cursor(commit=True) as cur:
|
||||
cur.execute("DELETE FROM devices WHERE id = %s RETURNING id", (device_id,))
|
||||
row = cur.fetchone()
|
||||
return row[0] if row else None
|
||||
|
||||
|
||||
def insert_tracking_points(device_id, points):
|
||||
"""Bulk-insert tracking points, skipping any that already exist
|
||||
(device_id, recorded_at) so a client can safely re-send a batch after a
|
||||
|
||||
Reference in New Issue
Block a user