cleanup: Remove debug console.log statements
This commit is contained in:
parent
b8bbd67e1f
commit
7eb2530bc9
@ -757,9 +757,6 @@ const csrfToken = document.querySelector('meta[name="csrf-token"]')?.content ||
|
||||
const appId = {{ application.id }};
|
||||
let pendingAction = null;
|
||||
|
||||
console.log('CSRF Token loaded:', csrfToken ? 'YES (length: ' + csrfToken.length + ')' : 'MISSING!');
|
||||
console.log('Application ID:', appId);
|
||||
|
||||
function showLoading() {
|
||||
document.getElementById('loadingOverlay').classList.add('show');
|
||||
}
|
||||
@ -847,7 +844,6 @@ function acceptChanges() {
|
||||
|
||||
async function doAcceptChanges() {
|
||||
showLoading();
|
||||
console.log('doAcceptChanges called, appId:', appId);
|
||||
|
||||
try {
|
||||
const response = await fetch(`/membership/review-changes/${appId}/accept`, {
|
||||
@ -859,38 +855,19 @@ async function doAcceptChanges() {
|
||||
body: JSON.stringify({})
|
||||
});
|
||||
|
||||
console.log('Response status:', response.status);
|
||||
console.log('Response ok:', response.ok);
|
||||
|
||||
const text = await response.text();
|
||||
console.log('Response text:', text);
|
||||
|
||||
let data;
|
||||
try {
|
||||
data = JSON.parse(text);
|
||||
} catch (parseError) {
|
||||
console.error('JSON parse error:', parseError);
|
||||
hideLoading();
|
||||
showNotification('Błąd parsowania odpowiedzi serwera', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('Parsed data:', data);
|
||||
const data = await response.json();
|
||||
hideLoading();
|
||||
|
||||
if (data.success) {
|
||||
console.log('Success! Calling showSuccessScreen...');
|
||||
showSuccessScreen(
|
||||
'accept',
|
||||
'Zmiany zaakceptowane!',
|
||||
'Twoja deklaracja wróciła do rozpatrzenia przez administratora. Otrzymasz powiadomienie o decyzji.'
|
||||
);
|
||||
} else {
|
||||
console.log('Server returned error:', data.error);
|
||||
showNotification(data.error || 'Wystąpił błąd', 'error');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Fetch error:', error);
|
||||
hideLoading();
|
||||
showNotification('Wystąpił błąd połączenia. Spróbuj ponownie.', 'error');
|
||||
}
|
||||
@ -940,17 +917,13 @@ async function doRejectChanges() {
|
||||
}
|
||||
|
||||
function showSuccessScreen(type, title, message) {
|
||||
console.log('showSuccessScreen called with:', type, title, message);
|
||||
|
||||
const overlay = document.getElementById('successOverlay');
|
||||
const icon = document.getElementById('successIcon');
|
||||
const titleEl = document.getElementById('successTitle');
|
||||
const messageEl = document.getElementById('successMessage');
|
||||
|
||||
console.log('Elements found - overlay:', !!overlay, 'icon:', !!icon, 'title:', !!titleEl, 'message:', !!messageEl);
|
||||
|
||||
if (!overlay) {
|
||||
console.error('CRITICAL: successOverlay element not found!');
|
||||
// Fallback - jeśli element nie istnieje, pokaż powiadomienie i przekieruj
|
||||
showNotification('Zmiany zapisane pomyślnie! Przekierowuję...', 'success');
|
||||
setTimeout(() => {
|
||||
window.location.href = '{{ url_for("membership.status") }}';
|
||||
@ -969,9 +942,7 @@ function showSuccessScreen(type, title, message) {
|
||||
icon.innerHTML = '<svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M12 8v4"/><path d="M12 16h.01"/></svg>';
|
||||
}
|
||||
|
||||
console.log('Adding show class to overlay');
|
||||
overlay.classList.add('show');
|
||||
console.log('Overlay classes now:', overlay.className);
|
||||
}
|
||||
|
||||
// Zamknij modal klikając poza nim
|
||||
|
||||
Loading…
Reference in New Issue
Block a user