Fix: Wiki-Foto-Moderation — 404 = bereits bearbeitet, Liste statt Fehlermeldung (SW by-v661)

This commit is contained in:
rene 2026-05-03 21:02:13 +02:00
parent e2cbbde7f2
commit 4cd2a33ca2
4 changed files with 16 additions and 7 deletions

View file

@ -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';

View file

@ -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';
}
}
});
});