mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 17:11:13 -05:00
Continue console cleanup
This commit is contained in:
@@ -15,6 +15,8 @@ import { toast } from '@/hooks/use-toast';
|
||||
import { PhotoUpload } from '@/components/upload/PhotoUpload';
|
||||
import { StarRating } from './StarRating';
|
||||
import { toDateOnly } from '@/lib/dateUtils';
|
||||
import { getErrorMessage } from '@/lib/errorHandler';
|
||||
import { logger } from '@/lib/logger';
|
||||
const reviewSchema = z.object({
|
||||
rating: z.number().min(0.5).max(5).multipleOf(0.5),
|
||||
title: z.string().optional(),
|
||||
@@ -107,7 +109,7 @@ export function ReviewForm({
|
||||
.insert(photoRecords);
|
||||
|
||||
if (photosError) {
|
||||
console.error('Error inserting review photos:', photosError);
|
||||
logger.error('Failed to insert review photos', { error: getErrorMessage(photosError) });
|
||||
// Don't throw - review is already created
|
||||
}
|
||||
}
|
||||
@@ -121,10 +123,9 @@ export function ReviewForm({
|
||||
setPhotos([]);
|
||||
onReviewSubmitted();
|
||||
} catch (error: unknown) {
|
||||
console.error('Error submitting review:', error);
|
||||
toast({
|
||||
title: "Error",
|
||||
description: "Failed to submit review. Please try again.",
|
||||
description: getErrorMessage(error),
|
||||
variant: "destructive"
|
||||
});
|
||||
} finally {
|
||||
|
||||
@@ -6,6 +6,8 @@ import { Star, ThumbsUp, Calendar, MapPin } from 'lucide-react';
|
||||
import { supabase } from '@/integrations/supabase/client';
|
||||
import { ReportButton } from '@/components/moderation/ReportButton';
|
||||
import { StarRating } from './StarRating';
|
||||
import { getErrorMessage } from '@/lib/errorHandler';
|
||||
import { logger } from '@/lib/logger';
|
||||
|
||||
interface ReviewWithProfile {
|
||||
id: string;
|
||||
@@ -63,7 +65,7 @@ export function ReviewsList({ entityType, entityId, entityName }: ReviewsListPro
|
||||
const { data } = await query;
|
||||
setReviews((data || []) as ReviewWithProfile[]);
|
||||
} catch (error: unknown) {
|
||||
console.error('Error fetching reviews:', error);
|
||||
logger.error('Failed to fetch reviews', { error: getErrorMessage(error), entityType, entityId });
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user