diff --git a/backend/routes/auth.py b/backend/routes/auth.py index 32d5c6c..e46cda0 100644 --- a/backend/routes/auth.py +++ b/backend/routes/auth.py @@ -197,7 +197,8 @@ async def me(user=Depends(get_current_user)): row = conn.execute( """SELECT id, name, real_name, email, rolle, is_premium, email_verified, bio, wohnort, erfahrung, social_link, - profil_sichtbarkeit, avatar_url, created_at + profil_sichtbarkeit, avatar_url, created_at, + is_founder, is_partner, founder_number FROM users WHERE id=?""", (user["id"],) ).fetchone() diff --git a/backend/routes/partner.py b/backend/routes/partner.py index 745fde7..359dc1c 100644 --- a/backend/routes/partner.py +++ b/backend/routes/partner.py @@ -92,14 +92,17 @@ def grant_user_status(user_id: int, data: GrantRequest, user=Depends(require_adm ).fetchone() if not target: raise HTTPException(404, "User nicht gefunden.") - # Beim manuellen Vergeben von is_founder: founder_number zuweisen wenn noch keine if updates.get("is_founder") == 1 and not target["founder_number"]: + # Neue Gründer-Nummer zuweisen total = conn.execute( "SELECT COUNT(*) FROM users WHERE is_founder=1" ).fetchone()[0] if total >= FOUNDER_MAX: raise HTTPException(400, f"Alle {FOUNDER_MAX} Gründer-Plätze sind vergeben.") updates["founder_number"] = total + 1 + elif updates.get("is_founder") == 0: + # Gründer-Status entfernen → founder_number ebenfalls leeren + updates["founder_number"] = None set_clause = ", ".join(f"{k}=?" for k in updates) conn.execute( f"UPDATE users SET {set_clause} WHERE id=?", diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 9d526bd..581a260 100644 --- a/backend/static/js/app.js +++ b/backend/static/js/app.js @@ -3,8 +3,8 @@ Router, State-Management, Navigation, Initialisierung. ============================================================ */ -const APP_VER = '533'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen -const APP_VERSION = '1.1.2'; // ← semantische Version, wird bei make release gesetzt +const APP_VER = '536'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VERSION = '1.1.3'; // ← semantische Version, wird bei make release gesetzt const IS_STAGING = location.hostname === 'staging.banyaro.app'; const App = (() => { diff --git a/backend/static/js/pages/settings.js b/backend/static/js/pages/settings.js index da7b4a7..37f67b5 100644 --- a/backend/static/js/pages/settings.js +++ b/backend/static/js/pages/settings.js @@ -64,8 +64,15 @@ window.Page_settings = (() => { } } - function refresh() { + async function refresh() { _render(); + if (_appState?.user) { + try { + const fresh = await API.auth.me(); + Object.assign(_appState.user, fresh); + _render(); + } catch {} + } } // ---------------------------------------------------------- diff --git a/backend/static/manifest.json b/backend/static/manifest.json index e4cfd81..d61feb7 100644 --- a/backend/static/manifest.json +++ b/backend/static/manifest.json @@ -1,6 +1,6 @@ { "id": "/", - "version": "1.1.2", + "version": "1.1.3", "name": "Ban Yaro — Die Hunde-Plattform", "short_name": "Ban Yaro", "description": "Alles rund um deinen Hund. Von Welpe bis Opa.", diff --git a/backend/static/sw.js b/backend/static/sw.js index fb662ef..ecb2350 100644 --- a/backend/static/sw.js +++ b/backend/static/sw.js @@ -3,7 +3,7 @@ Offline-Cache + Push Notifications + Tile-Cache ============================================================ */ -const CACHE_VERSION = 'by-v556'; +const CACHE_VERSION = 'by-v559'; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache