From a70502fb7756b35783e12145834c63e3d6362e86 Mon Sep 17 00:00:00 2001 From: Marc Date: Fri, 6 Feb 2026 08:33:42 -0600 Subject: [PATCH] endpoints return empty results gracefully instead of 400 errors --- routes/gsm_spy.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/routes/gsm_spy.py b/routes/gsm_spy.py index 98732b3..03426d9 100644 --- a/routes/gsm_spy.py +++ b/routes/gsm_spy.py @@ -841,7 +841,12 @@ def get_life_patterns(): try: device_id = request.args.get('device_id') if not device_id: - return jsonify({'error': 'device_id required'}), 400 + # Return empty results gracefully when no device selected + return jsonify({ + 'device_id': None, + 'patterns': [], + 'message': 'No device selected' + }), 200 with get_db() as conn: # Get historical signal data @@ -898,7 +903,13 @@ def neighbor_audit(): try: cid = request.args.get('cid') if not cid: - return jsonify({'error': 'cid required'}), 400 + # Return empty results gracefully when no tower selected + return jsonify({ + 'cid': None, + 'neighbors': [], + 'inconsistencies': [], + 'message': 'No tower selected' + }), 200 with get_db() as conn: # Get tower info with metadata (neighbor list stored in metadata JSON)