working on new system for importing
This commit is contained in:
@@ -199,14 +199,25 @@ function initializeBatchProgressUI() {
|
||||
|
||||
async function cancelBatch(batchId) {
|
||||
try {
|
||||
const resp = await window.http.wrappedFetch(`/api/billing/statements/batch-progress/${encodeURIComponent(batchId)}`, { method: 'DELETE' });
|
||||
if (!resp.ok) {
|
||||
throw await window.http.toError(resp, 'Failed to cancel batch');
|
||||
if (!confirm(`Are you sure you want to cancel batch ${batchId}?`)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Import functionality removed
|
||||
|
||||
const result = await resp.json();
|
||||
console.log('Import batch cancelled:', result.message);
|
||||
|
||||
// Let stream update the row; no-op here
|
||||
// The progress will be updated via WebSocket
|
||||
} catch (e) {
|
||||
console.warn('Cancel failed', e);
|
||||
try { alert(window.http.formatAlert(e, 'Cancel failed')); } catch (_) {}
|
||||
console.warn('Cancel import batch failed', e);
|
||||
try {
|
||||
const errorMsg = window.http.formatAlert(e, 'Cancel import batch failed');
|
||||
alert(errorMsg);
|
||||
} catch (_) {
|
||||
alert('Failed to cancel import batch');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -464,14 +475,7 @@ async function checkUserPermissions() {
|
||||
const adminDivider = document.getElementById('admin-menu-divider');
|
||||
if (adminItem) adminItem.classList.remove('hidden');
|
||||
if (adminDivider) adminDivider.classList.remove('hidden');
|
||||
const importDesktop = document.getElementById('nav-import-desktop');
|
||||
const importMobile = document.getElementById('nav-import-mobile');
|
||||
if (importDesktop) importDesktop.classList.remove('hidden');
|
||||
if (importMobile) importMobile.classList.remove('hidden');
|
||||
const flexibleDesktop = document.getElementById('nav-flexible-desktop');
|
||||
const flexibleMobile = document.getElementById('nav-flexible-mobile');
|
||||
if (flexibleDesktop) flexibleDesktop.classList.remove('hidden');
|
||||
if (flexibleMobile) flexibleMobile.classList.remove('hidden');
|
||||
// Import navigation items removed
|
||||
}
|
||||
const userDropdownName = document.querySelector('#userDropdown button span');
|
||||
if (user.full_name && userDropdownName) {
|
||||
|
||||
Reference in New Issue
Block a user