From 4cd2a33ca26a2e38ae26a015ef136837fad4bc68 Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 3 May 2026 21:02:13 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20Wiki-Foto-Moderation=20=E2=80=94=20404?= =?UTF-8?q?=20=3D=20bereits=20bearbeitet,=20Liste=20statt=20Fehlermeldung?= =?UTF-8?q?=20(SW=20by-v661)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/static/index.html | 8 ++++---- backend/static/js/app.js | 2 +- backend/static/js/pages/moderation.js | 11 ++++++++++- backend/static/sw.js | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/backend/static/index.html b/backend/static/index.html index 55a7e59..97ba52b 100644 --- a/backend/static/index.html +++ b/backend/static/index.html @@ -93,9 +93,9 @@ - - - + + + @@ -562,7 +562,7 @@ - + diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 1c14738..9de544d 100644 --- a/backend/static/js/app.js +++ b/backend/static/js/app.js @@ -3,7 +3,7 @@ Router, State-Management, Navigation, Initialisierung. ============================================================ */ -const APP_VER = '660'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '661'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.3.0'; // ← semantische Version, wird bei make release gesetzt const IS_STAGING = location.hostname === 'staging.banyaro.app'; diff --git a/backend/static/js/pages/moderation.js b/backend/static/js/pages/moderation.js index 5281850..18bdaac 100644 --- a/backend/static/js/pages/moderation.js +++ b/backend/static/js/pages/moderation.js @@ -217,7 +217,16 @@ window.Page_moderation = (() => { await API.patch(`/moderation/fotos/${btn.dataset.id}`, { action: 'approve' }); UI.toast('Foto freigegeben.', 'success'); await _loadFotos(el); - } catch (e) { UI.toast(e.message, 'danger'); btn.disabled = false; btn.textContent = '✓ Freigeben'; } + } catch (e) { + if (e.status === 404) { + UI.toast('Bereits bearbeitet — Liste aktualisiert.', 'info'); + await _loadFotos(el); + } else { + UI.toast(e.message, 'danger'); + btn.disabled = false; + btn.textContent = '✓ Freigeben'; + } + } }); }); diff --git a/backend/static/sw.js b/backend/static/sw.js index 90cdf3a..3ce0837 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-v660'; +const CACHE_VERSION = 'by-v661'; 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