mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 11:51:14 -05:00
Refactor: Implement logging phases
This commit is contained in:
@@ -23,6 +23,7 @@ import { User, MapPin, Calendar, Star, Trophy, Settings, Camera, Edit3, Save, X,
|
||||
import { Profile as ProfileType } from '@/types/database';
|
||||
import { supabase } from '@/integrations/supabase/client';
|
||||
import { useToast } from '@/hooks/use-toast';
|
||||
import { logger } from '@/lib/logger';
|
||||
import { getErrorMessage } from '@/lib/errorHandler';
|
||||
import { PhotoUpload } from '@/components/upload/PhotoUpload';
|
||||
import { profileEditSchema } from '@/lib/validation';
|
||||
@@ -215,7 +216,7 @@ export default function Profile() {
|
||||
parkCount: parkCount
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error fetching calculated stats:', error);
|
||||
logger.error('Error fetching calculated stats', { error });
|
||||
toast({
|
||||
variant: 'destructive',
|
||||
description: getErrorMessage(error),
|
||||
@@ -379,7 +380,7 @@ export default function Profile() {
|
||||
|
||||
setRecentActivity(combined);
|
||||
} catch (error) {
|
||||
console.error('Error fetching recent activity:', error);
|
||||
logger.error('Error fetching recent activity', { error });
|
||||
toast({
|
||||
variant: 'destructive',
|
||||
description: getErrorMessage(error),
|
||||
@@ -440,7 +441,7 @@ export default function Profile() {
|
||||
await fetchRecentActivity(data.user_id || '');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error fetching profile:', error);
|
||||
logger.error('Error fetching profile', { error });
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: "Error loading profile",
|
||||
@@ -481,7 +482,7 @@ export default function Profile() {
|
||||
await fetchRecentActivity(user.id);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error fetching profile:', error);
|
||||
logger.error('Error fetching profile', { error });
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: "Error loading profile",
|
||||
|
||||
Reference in New Issue
Block a user