remove old import

This commit is contained in:
HotSwapp
2025-08-14 21:27:34 -05:00
parent bfc04a6909
commit 679ab4446a
17 changed files with 2016 additions and 557 deletions

View File

@@ -804,7 +804,7 @@ function clearUploadFileNo() {
async function loadTemplates() {
try {
console.log('🔍 DEBUG: loadTemplates() called');
// Loading templates...
const search = document.getElementById('templateSearch').value;
const category = document.getElementById('categoryFilter').value;
@@ -814,17 +814,17 @@ async function loadTemplates() {
// Ensure we have auth token for this API call
const token = localStorage.getItem('auth_token');
console.log('🔍 DEBUG: Token exists:', !!token, 'Length:', token?.length);
// Token validation
if (!token) {
console.log('🔍 DEBUG: No token found, redirecting to login');
// No token found, redirecting to login
window.location.href = '/login';
return;
}
console.log('🔍 DEBUG: Making API call to:', url);
// Making API call
const response = await window.http.wrappedFetch(url);
console.log('🔍 DEBUG: Response status:', response.status);
// Processing response
if (!response.ok) {
const errorData = await response.json().catch(() => ({ detail: 'Unknown error' }));
@@ -832,10 +832,10 @@ async function loadTemplates() {
}
const templates = await response.json();
console.log('🔍 DEBUG: Templates loaded:', templates.length, 'items');
// Templates loaded successfully
displayTemplates(templates);
} catch (error) {
console.error('🔍 DEBUG: Error in loadTemplates:', error);
console.error('Error in loadTemplates:', error);
try { logClientError({ message: 'Error loading templates', action: 'loadTemplates', error }); } catch (_) {}
showAlert('Error loading templates: ' + (error && error.message ? error.message : 'Unknown error'), 'danger');
}