mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-25 14:51:13 -05:00
Refactor: Implement logging phases
This commit is contained in:
@@ -14,6 +14,7 @@ import { Company, Park } from '@/types/database';
|
||||
import { supabase } from '@/integrations/supabase/client';
|
||||
import { OperatorPhotoGallery } from '@/components/companies/OperatorPhotoGallery';
|
||||
import { ParkCard } from '@/components/parks/ParkCard';
|
||||
import { logger } from '@/lib/logger';
|
||||
|
||||
// Lazy load admin form
|
||||
const OperatorForm = lazy(() => import('@/components/admin/OperatorForm').then(m => ({ default: m.OperatorForm })));
|
||||
@@ -89,7 +90,7 @@ export default function OperatorDetail() {
|
||||
fetchPhotoCount(data.id);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error fetching operator:', error);
|
||||
logger.error('Error fetching operator', { error });
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
@@ -110,7 +111,7 @@ export default function OperatorDetail() {
|
||||
if (error) throw error;
|
||||
setParks(data || []);
|
||||
} catch (error) {
|
||||
console.error('Error fetching parks:', error);
|
||||
logger.error('Error fetching parks', { error });
|
||||
} finally {
|
||||
setParksLoading(false);
|
||||
}
|
||||
@@ -137,7 +138,7 @@ export default function OperatorDetail() {
|
||||
if (ridesError) throw ridesError;
|
||||
setOperatingRides(ridesData?.length || 0);
|
||||
} catch (error) {
|
||||
console.error('Error fetching statistics:', error);
|
||||
logger.error('Error fetching statistics', { error });
|
||||
} finally {
|
||||
setStatsLoading(false);
|
||||
}
|
||||
@@ -154,7 +155,7 @@ export default function OperatorDetail() {
|
||||
if (error) throw error;
|
||||
setTotalPhotos(count || 0);
|
||||
} catch (error) {
|
||||
console.error('Error fetching photo count:', error);
|
||||
logger.error('Error fetching photo count', { error });
|
||||
setTotalPhotos(0);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user