From b2464c291236f539a510ad8ebbad35f8e1a93f22 Mon Sep 17 00:00:00 2001 From: Reditus Date: Tue, 12 May 2026 03:40:16 +0100 Subject: [PATCH] Restore missing update API routes in api.py --- app/routes/api.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/app/routes/api.py b/app/routes/api.py index 1d31ac7..5df0cbc 100644 --- a/app/routes/api.py +++ b/app/routes/api.py @@ -698,3 +698,31 @@ def register_api_routes(app, services, settings): return result, 200, {'Content-Type': 'application/json'} except Exception as e: return jsonify({'success': False, 'error': str(e)}), 500 + + # Update management + @app.route('/api/update/status') + def api_update_status(): + updater = services.get('updater') + if not updater: + return jsonify({'available': False}) + return jsonify({ + 'available': updater.update_available, + 'status': updater.update_status, + }) + + @app.route('/api/update/apply', methods=['POST']) + def api_update_apply(): + updater = services.get('updater') + if not updater: + return jsonify({'success': False, 'error': 'Updater not available'}) + success, message = updater.apply_update() + return jsonify({'success': success, 'message': message}) + + @app.route('/api/update/test', methods=['POST']) + def api_update_test(): + """Force show update banner for testing.""" + updater = services.get('updater') + if updater: + updater._update_available = True + return jsonify({'success': True, 'message': 'Update banner triggered'}) + return jsonify({'success': False, 'error': 'Updater not available'})