feat: checkbox batch trip delete on the Pi (local-only)
- Pi history page gets a select checkbox column + 'Delete selected' button (mirrors the server UI) - POST /api/trips/delete batch endpoint - app_sql.delete_trips_batch() + deleted_trip_markers table so a later trip rebuild can't resurrect locally-deleted trips - Deletion is local-only: raw tracking rows are kept and the remote server is never notified (it keeps its archival copy recomputed from uploaded rows)
This commit is contained in:
@@ -232,6 +232,19 @@ def api_delete_trip(trip_id):
|
||||
return jsonify(error=f"Trip not found: {trip_id}"), 404
|
||||
return jsonify(status="deleted"), 200
|
||||
|
||||
@app.route('/api/trips/delete', methods=['POST'])
|
||||
def api_delete_trips_batch():
|
||||
"""Batch-delete computed trips on the Pi only (local archival cleanup).
|
||||
|
||||
The remote server is NOT told — it keeps its own archival copy of every
|
||||
trip, recomputed from the uploaded tracking rows."""
|
||||
body = request.get_json(silent=True) or {}
|
||||
ids = body.get("ids")
|
||||
if not isinstance(ids, list) or not ids:
|
||||
return jsonify(error="expected {ids: [...]}"), 400
|
||||
deleted = app_sql.delete_trips_batch(ids)
|
||||
return jsonify(status="deleted", deleted=deleted), 200
|
||||
|
||||
import functools
|
||||
import reverse_geocoder as rg
|
||||
|
||||
|
||||
Reference in New Issue
Block a user