Phase 1: Code cleanup - remove unused pages, components, and console.logs
- Deleted 6 empty folders (pages/Admin, pages/admin, pages/settings, components/debug, components/widgets, components/metrics) - Removed unused template components: - ecommerce/ (7 files) - sample-componeents/ (2 HTML files) - charts/bar/ and charts/line/ - tables/BasicTables/ - Deleted deprecated file: CurrentProcessingCard.old.tsx - Removed console.log statements from: - UserProfile components (UserMetaCard, UserAddressCard, UserInfoCard) - Automation/ConfigModal - ImageQueueModal (8 statements) - ImageGenerationCard (7 statements) - Applied ESLint auto-fixes (9 errors fixed) - All builds pass ✓ - TypeScript compiles without errors ✓
This commit is contained in:
@@ -227,14 +227,14 @@ export async function fetchAPI(endpoint: string, options?: RequestInit & { timeo
|
||||
}
|
||||
|
||||
// Throw authentication error
|
||||
let err: any = new Error(errorMessage);
|
||||
const err: any = new Error(errorMessage);
|
||||
err.status = 403;
|
||||
err.data = errorData;
|
||||
throw err;
|
||||
}
|
||||
|
||||
// Not an auth error - could be permissions/plan issue - don't force logout
|
||||
let err: any = new Error(errorMessage);
|
||||
const err: any = new Error(errorMessage);
|
||||
err.status = 403;
|
||||
err.data = errorData;
|
||||
throw err;
|
||||
@@ -243,7 +243,7 @@ export async function fetchAPI(endpoint: string, options?: RequestInit & { timeo
|
||||
if (e.status === 403) throw e;
|
||||
|
||||
// Parsing failed - throw generic 403 error
|
||||
let err: any = new Error(text || response.statusText);
|
||||
const err: any = new Error(text || response.statusText);
|
||||
err.status = 403;
|
||||
throw err;
|
||||
}
|
||||
@@ -251,7 +251,7 @@ export async function fetchAPI(endpoint: string, options?: RequestInit & { timeo
|
||||
|
||||
// Handle 402 Payment Required - plan/limits issue
|
||||
if (response.status === 402) {
|
||||
let err: any = new Error(response.statusText);
|
||||
const err: any = new Error(response.statusText);
|
||||
err.status = response.status;
|
||||
try {
|
||||
const parsed = text ? JSON.parse(text) : null;
|
||||
@@ -295,7 +295,7 @@ export async function fetchAPI(endpoint: string, options?: RequestInit & { timeo
|
||||
logout();
|
||||
|
||||
// Throw error to stop request processing
|
||||
let err: any = new Error(errorData.error || 'Session ended');
|
||||
const err: any = new Error(errorData.error || 'Session ended');
|
||||
err.status = 401;
|
||||
err.data = errorData;
|
||||
throw err;
|
||||
@@ -368,7 +368,7 @@ export async function fetchAPI(endpoint: string, options?: RequestInit & { timeo
|
||||
return null;
|
||||
} else {
|
||||
// Retry failed - parse and throw the retry error (not the original 401)
|
||||
let retryError: any = new Error(retryResponse.statusText);
|
||||
const retryError: any = new Error(retryResponse.statusText);
|
||||
retryError.status = retryResponse.status;
|
||||
try {
|
||||
const retryErrorData = JSON.parse(retryText);
|
||||
|
||||
Reference in New Issue
Block a user