diff --git a/routes/api_routes.py b/routes/api_routes.py index 23163b6..6959d7d 100644 --- a/routes/api_routes.py +++ b/routes/api_routes.py @@ -371,7 +371,7 @@ def background_gitea_check(): except Exception as e: logger.error(f"Errore controllo Gitea in background: {e}") -@api_bp.route('/api/server_update/status', methods=['GET']) +@api_bp.route('/api/server_update/check', methods=['GET']) def get_server_update_status(): global LAST_GITEA_CHECK_TIME auth = get_auth() diff --git a/static/js/app.js b/static/js/app.js index 8b5c208..1ce76ba 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -1372,7 +1372,7 @@ function urlB64ToUint8Array(base64String) { const padding = '='.repeat((4 - base async function checkServerUpdate() { if (!isAuthenticated || me.role !== 'admin') return; - try { const res = await fetch('/api/server_update/check'); const data = await res.json(); const btn = document.getElementById('server-update-btn'); if (btn) { btn.style.display = data.update_available ? 'inline-block' : 'none'; } } catch (e) { console.error(e); } + try { const res = await fetch('/api/server_update/check'); if (!res.ok) return; const data = await res.json(); const btn = document.getElementById('server-update-btn'); if (btn) { btn.style.display = data.update_available ? 'inline-block' : 'none'; } } catch (e) { console.error(e); } } function confirmServerUpdate() {